Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to retrieve SQL Identity Column values?
Message
De
03/10/2001 08:46:10
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00562994
Message ID:
00563522
Vues:
28
Vlad:
Just to follow up for others who might not be aware. I had tried this approach some time ago, but could never get the SQLEXEC to return a result set. I found in BOL where in asynch mode, you have to repeatedly call SQLEXEC until it returns a result set. So I modified your code just a bit as follows:

Local lnRetVal

lnRetVal = SQLEXEC(nHandle, "SELECT @@IDENTITY as nID","MyCursor")
Do While lnRetVal=0
lnRetVal = SQLEXEC(nHandle, "SELECT @@IDENTITY as nID","MyCursor")
EndDo

This seems to always catch it on just the second pass.

Thanks again...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform