Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote views, Tableupdate and identity keys
Message
From
19/06/2011 17:30:08
 
 
To
19/06/2011 17:10:45
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01515107
Message ID:
01515108
Views:
69
Well, Charles, I'm glad you asked that question

It seems somewhere between 2006 when even Ander Altberg was giving completely wrong answers to this question, insisting on not understanding the differences between remote views and SPT or suggesting going for @@identity with the known problems with triggers, there is a value IDENT_CURRENT(tablename) which gives you exactly what you need.

Since you are known to be somewhat senile and will probably ask this question again I hope you will find this useful when you search for it.

( but my , you are looking good ... )

>Feel like somebody here knows the answer to this :

>
>If I send an update to the backend with SPT I can pull back the SCOPE_IDENTITY() so I can set the FKs in children before I save them.
>
>But if I am calling Tableupdate() the SPT is created for me from the remote view and I haven't figured out how to get back the PK of the record just added.
>
>My framework uses remote views and ultimately Tableupdate() to insert a new record on the back end. Is there a way to get the remote views themselves to return the pk value?
>
>Once the tableupdate() returns true or false I no longer can send SPT that will see SCOPE_IDENTITY(). Do I need to munge up something with a candidate key generated on the front end in order to get back the pk of the record just inserted?
>
>Remember, these are remote views. I understand how to do it in SPT but the tableupdate doesn't provide a place I can see to ask for scope_identity in the same scope.
>
>TIA


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform