Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subquery with INSERT
Message
 
 
À
27/08/2009 12:54:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01421215
Message ID:
01421219
Vues:
36
>Is it possible to use a subquery to return the KeyID of a newly INSERTed record? Something like this:
>
>&& pseudo code
>select max(keyid) from (insert into tip (st_name) values ('test'))
>
>What would be the syntax?
>Thanks

No. There have to be two separate commands. The second may be
select GetAutoIncValue()
for the AutoInc ID in VFP.

In SQL Server you can either use OUTPUT clause or select SCOPE_IDENTITY()
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform