Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SPT, updatable cursor and last identity value
Message
De
08/04/2010 02:08:10
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01458392
Message ID:
01459291
Vues:
47
This message has been marked as a message which has helped to the initial question of the thread.
>>>>>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.
>>
>>Why?
>
>What if something happens in between?

What can happen?

The SQL session is exclusive,
and therefore your application must have the control of what can happen.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform