1. Ruslan Zasukhin
  2. BETA Testing
  3. Saturday, June 27 2015, 06:03 AM
  4.  Subscribe via email
Hi Valentina Developers,

Now you can use in Valentina 6.0 a new powerful command 'MERGE'. This command is from SQL2003 standard.

This command allows you to combine by some logic INSERT, UPDATE, DELETE in the single command. On of the simplest tasks it can solve - is so named UPSERT = UPdate + inSERT

In the SQL2003 standard they talk only about UPDATE and INSERT. We have take some ideas from MS SQL, to be able to do DELETE also.

You can read syntax of this new command on WIKI page about Valentina SQL 6.0 Grammar
Comment
There are no comments made yet.
Ruslan Zasukhin Accepted Answer
EXAMPLE of UPSERT task with help of MERGE:

- Let you have tables T1 (ID, f2) and T2 (ID, f2)
- Let you want COPY values from T2.f2 to T1.f2 if that records have the same API.

Up to now this was possible todo with sub-query of kind
UPDATE T1 SET f2 = (SELECT f2 FROM T2 join T1 ON T2.ID=T1.ID)

Query which do the same job, and much more effective looks as

MERGE INTO T1
USING T2 ON T2.ID = T1.ID
WHEN MATCHED THEN
UPDATE SET f2 = T2.f2
Comment
There are no comments made yet.
  1. more than a month ago
  2. BETA Testing
  3. # 1
  • Page :
  • 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