1. Ruslan Zasukhin
  2. Announcements & News
  3. 土, 9月 16 2017, 05:20 PM
  4.  メールで購読
Hi Valentina Devs,

For those who use Valentina Links: we have to improve LINK RECORDS command.

When you add records to T1 and T2, to link them you need RecIDs of that last added records.
Up to now you could write this set of SQL commands to do this task:

INSERT INTO T1(f1,f2,f3) VALUES(v1,v2,v3);
SET @last_T1 = last_recid_of_table( 'T1' );

INSERT INTO T2(f1,f2,f3) VALUES(v11,v12,v13);
SET @last_T2 = last_recid_of_table( 'T2' );

LINK RECORD(@last_T1) OF T1 WITH RECORD(@last_T2) OF T2;



Now you can do this much simpler:

INSERT INTO T1(f1,f2,f3) VALUES(v1,v2,v3);
INSERT INTO T2(f1,f2,f3) VALUES(v11,v12,v13);

LINK RECORD(LAST) OF T1 WITH RECORD(LAST) OF T2;
コメント
There are no comments made yet.
Scott 承諾済みの回答
Will this work in a multi-user network environment?
コメント
There are no comments made yet.
Scott 承諾済みの回答
Also, I am assuming this is a future feature? It does not work in 7.4.3


CREATE PROCEDURE "insertWithLink"( IN fld1A VarChar, IN fld2A VarChar, IN fld3B VarChar, IN fld4B VarChar )
BEGIN
insert into tbl1(fld1, fld2) VALUES (fld1A, fld2A);
insert into tbl2(fld3, fld4) VALUES (fld3B, fld4B);
LINK RECORD(LAST) of tbl1 with RECORD(LAST) of tbl2
END;


Gives a Kernel error
コメント
There are no comments made yet.
Ruslan Zasukhin 承諾済みの回答
Hi Scott,

Yes it will work under VSERVER of course.
I use it right now to make REST - python scripts to load results of our benches from TXT into VSERVER.

In VServer, when you use last_recid_of_table() -- it is also safe for multi-user. Each user have own value of lastRecID.

Yes, this will be available in the next 7.4.4 release. Please wait yet few days
コメント
There are no comments made yet.
Scott 承諾済みの回答
Thanks Ruslan, can't wait for the new feature!

I have been using the last_recid_of_table() for quite some time - I find it very efficient and easy to use. Especially because I am not an SQL expert by any means. :o This makes binary linking easy - even on client/server applications because I can off load most of my BI to the VSERVER in function/methods.
コメント
There are no comments made yet.
  • ページ :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories