Addition of ORDER BY for MERGE?

10 views
Skip to first unread message

Mark Rotteveel

unread,
May 7, 2023, 9:43:55 AM5/7/23
to firebir...@googlegroups.com
Looking through the docs folder, I noticed that the PLAN, ORDER BY and
ROWS clauses were added to UPDATE OR INSERT, and the PLAN and ORDER BY
clauses to MERGE as part of the addition of multi-row RETURNING.

The PLAN I can understand, and I can guess at the usefulness of having
an ORDER BY and ROWS with UPDATE OR INSERT if there are multiple
matching records, but I'm not sure of the point of ORDER BY on MERGE.

When would it be useful to have an ORDER BY on MERGE? I'm primarily
looking at it from the perspective of what I can put in the language
reference to say why you'd use it in a MERGE. Is it just to influence
the order of rows returned by RETURNING, or could there be some
additional benefit from ordering?

Mark
--
Mark Rotteveel

Adriano dos Santos Fernandes

unread,
May 8, 2023, 6:18:27 AM5/8/23
to firebir...@googlegroups.com
Workaround for the problem we're discussing few days ago, where order of
updates matter (FK checked during updates, not at the end).


Adriano


Reply all
Reply to author
Forward
0 new messages