Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SPT, updatable cursor and last identity value
Message
 
 
To
07/04/2010 13:49:19
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01458392
Message ID:
01459219
Views:
40
>>Fabio,
>>
>>Please read the problem defintion one more time. The SPT cursor is made updatable using technique similar to the one outlined in Vald's blog (so essentially it becomes a remote view).
>>
>>After that we do simple append blank (on insert, doesn't matter) and then tableupdate.
>>
>>My question is how can I get the ID in this particular scenario.
>>
>
>
>IF TABLEUPDATE(.F.)
>  LOCAL newid
>  newid=cast(null as i)
>  SQLEXEC(CURSORGETPROP("ConnectHandle"),"SELECT ?@m.newid = SCOPE_IDENTITY()")
>ENDIF
>
>
We're using a similar approach, but I don't think it's reliable.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform