Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AutoInc data type
Message
 
 
À
16/04/2003 15:40:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00778507
Message ID:
00778561
Vues:
21
Thank you for your opinion, I am currently writing an application that needs to connect to either VFP free tables or SQL Server backend, user option. And don't know which is the easiest way to go.





>>I have a field which uses the new AutoInc Integer type, and I would like to get the new ID value after I issue an INSERT INTO statement. Something like @@Identity in SQL Server. Is it possible?
>>
>>
>
>If you know the name of the primary key field:
>
>
>INSERT INTO table1 ....
>? table1.keyID
>
>
>If your program doesn't know the name of the primary key field, see KEY(), TAGCOUNT(), PRIMARY() functions...your code can figure out the name of the primary key field. Then use eval() to get the new key:
>
>For example, assuming the primary key is the first index tag:
>
>lcKeyField = "table1." + key(1)  && you'd have to SELECT the table, and then set the work area back
>? eval(lcKeyField)
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform