Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subquery with INSERT
Message
 
 
To
27/08/2009 12:54:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01421215
Message ID:
01421219
Views:
35
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform