[FAQ] SQL SELECT on multiple tables joined by binary link

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Tue Nov 15 11:24:11 CST 2011


Hi All,

This is copied from Valentina Billets support ...


===================================
> I searched in the the Wiki for the following question but did not find
> anything really helpful:
> 
> I have tables T1 and T2, and a binary link B1. And I want to mention that we
> often have multiple different binary links like B2 and B3 all relating between
> the tables T1 and T2....
> 
> Question 1:
> How can I select between T1 and join to T2 and also explicitly tell to use B1
> for the inner/outer join?
> 
> Question 2:
> How can I select the both columns of such a binary link as if they were an
> ordinary table with 2 columns?
> 
> Question 3:
> How can I create/update/remove a link between RecId 5 of T1 and RecId 7 of T2
> through SQL? currently I only know the way through the IVLink-API which is not
> an option for us.

4:
 
> Ideally I would like to threat the "link tables" like an ordinary table with
> foreign keys to tables T1 and T2.
> 

=====================================
ANSWER 1:

        SELECT ...
        FROM T1 [outer] join T2 USING link_name_1

ANSWER 2:

        "LINK link_name_1;"

        Note, that in SQL standard you can do:  "TABLE T1"  and this is 100%
the same as "SEELCT * FROM T1".
        So we have made analog for binary links


ANSWER3 :

        You can use LINK/UNLINK commands.


It seems to me you have not see this page -- Entry point about Valentina
Links, which have links to description, to API and to SQL related to links.

http://www.valentina-db.com/dokuwiki/doku.php?id=valentina:vcomponents:vkern
el:vlink:vlink


====================================
4:

Hmm, Links exactly are not tables :-)

Not by sense, not by implementation, not by API, not by behavior.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list