` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

SQL Related Articles: Retrieving Identity value from MSSQL
2003-11-24 -- Sebastian Streiger
 
Newsgroups: softvelocity.public.clarion6 Access:Customer.TryInsert() Customer{Prop:SQL} = 'SELECT @@IDENTITY' If Access:Customer.TryNext() <> Level:Benign !Something went wrong here End MESSAGE(Customer:SysId) !Now you should get what you wanted. !This will return the value of the last identity inserted in the current session. !No posible clash with other users !I'm asumming that Customer:SysId is the first field in the Customers table. !If it's not you should add dummy values to the select so that the identity fits the proper buffer position Just one warning. @@IDENTITY is a MSSQL variable, it won't work with another back-end. Also it returns the last inserted identity of the current session, no matter wich tabl;e was the last that was inserted into. So you should be aware that a trigger for example can make the previous code errorneous. Hpe this helps -- Sebastián Streiger IT Department Red Megatone


Today is May 4, 2024, 9:52 pm
This article has been viewed 35112 times.
Google search has resulted in 303 hits on this article since January 25, 2004.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: