SQL Select with Binary Link

Ivan Smahin ivan_smahin at paradigmasoft.com
Wed May 21 04:16:41 CDT 2008


Hello Ruslan,

Wednesday, May 21, 2008, 11:55:28 AM, you wrote:

> On 5/21/08 10:19 AM, "Bart Pietercil" <bart.pietercil at cognosis.be> wrote:

>> Hi,
>> 
>> I am surprised by this
>> On 21 May 2008, at 09:09, Ruslan Zasukhin wrote:
>> 
>>> 
>>>    insert into link link_name VALUES( lastreid(cust) , lastreid(ph) )
>> 
>> I thought lastrecid was a function on db level and as I understand it,
>> you are using it as if it is stored (lastrecid) per table ?

> Aha, then ops. 

> I have write a dream...


Still simple workaround exists.

The fact we have to remember - any single call to the kernel/server
can not be interrupted by another user/thread.

So do something like this:

SQLExecute( "insert into t1 VALUES (1); "
            "SET @recID1 = select lastRecid(); "
            "insert into t2 VALUES (1); "
            "SET @recID2 = select lastRecid(); "
            "insert into link link_name VALUES( @recID1 , @recID2 ); "
            )


-- 
Best regards,
Ivan Smahin 
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com



More information about the Valentina mailing list