Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Insert with 2 primary keys in xref table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01265745
Message ID:
01265912
Vues:
8
Sergey,
here is the revised code that does work as I want. I have a cross reference table that matches employees with deductions using keys K_PREMPL and K_PRDEDEMP. I need to add new records where K_PREMPL+K_PRDEDEMP exist in the cursor c_PenDetail but do not exist in prdedemp.
* Add any missing deduction types for each employee.
TEXT TO mSqlCommand noshow pretext 15 TEXTMERGE
  insert into <<xfprdedemp>>
  (k_prempl, k_prdedmst)

  select k_prempl, k_prdedmst
  from c_PenDetail

  where transform(k_prdedmst,'9999999999')+ transform(k_prempl,'9999999999')
  not in (select transform(k_prdedmst,'9999999999')+ transform(k_prempl,'9999999999') from prdedemp)
ENDTEXT
&mSqlCommand
Is there a better way than using the transform to concatenate the fields?
Thanks,
John.

>John,
>
>It's not clear what you're trying to do and your query doesn't make any sense. Can you elaborate?
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform