1. Vladimir Esipov
  2. Valentina Server
  3. Friday, December 01 2023, 07:20 PM
  4.  Subscribe via email
The WIKI for the release of VDB 12 announced a new feature - a connection between two databases.
Can you explain in more detail - what do you mean?

MySQL/MariaDB allows you to execute a query like:


SELECT T1.fld1, T2.fld2
FROM DB1.tbl1 as T1, DB2.tbl2 as T2
WHERE T1.fld1 = T2.fld2
LIMIT 10;


A similar query in VDB results in an error


SELECT RecID FROM DB1.tbl1;


Kernel Error: 0xa000. "Full name "DB1.tbl1" is not supported in this context." is not supported.

Is it possible in VDB to perform cross-database queries on databases registered on the same server?
Comment
There are no comments made yet.
Ivan Smahin Accepted Answer
The "full table names" like db1.t1 are allowed in some special cases like joins.

For example:


select a.f1, b.f1 from Db_Join_1.t1 a, Db_Join_2.t1 b WHERE a.id = b.ptr
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 1
Ivan Smahin Accepted Answer
Joins, unions allow fully qualified table names from different db, but it works with some restrictions. The only traditional relations (by value) is possible to build a join result. So, neither ObjectPtr nor binary links can be used in such context.

Sure, both dbs must be registered and opened.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 2
Vladimir Esipov Accepted Answer
Hi Ivan, thanks for the tip. I see that you have added explanations to the UNION, INTERSECT and EXCEPT
page on the WIKI.

There is also no NOTIFY CHANNEL, [UN]SUBSCRIBE commands in the SQL section.
Your team is working to expand the capabilities of the VDB engine, but it will be difficult for a new user to find them, if they are not described in the appropriate sections of WIKI.
Not everyone will study announcements of all releases to find out all VDB feautures.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 3
Ivan Smahin Accepted Answer
Hi Vladimir,

Thank you for that - fixed.

(Un)Subscribe

Notify
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 4
Vladimir Esipov Accepted Answer
OK, tx
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 5
  • Page :
  • 1


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