2

How to update multiple tables in a orientdb using single query?

Looking for something like this

UPDATE table1, table2
    SET table1.col = a,
         table2.col2 = b
    WHERE table1.id = table2 .id;
Community
  • 1
  • 1
Pyntamil Selvi
  • 161
  • 1
  • 6
  • 17
  • You can't update multiple tables in one statement http://stackoverflow.com/questions/2044467/how-to-update-two-tables-in-one-statement-in-sql-server-2005 – Vecchiasignora Apr 18 '17 at 11:17

1 Answers1

0

You can't update multiple tables in one statement, however, you can use a transaction to make sure that two UPDATE statements are treated atomically. You can also batch them to avoid a round trip.

Nithin
  • 1,376
  • 12
  • 29
  • 2
    Something more than a copy&paste from here? https://stackoverflow.com/questions/2044467/how-to-update-two-tables-in-one-statement-in-sql-server-2005 – Andrea Jun 15 '18 at 14:24