Subject Re: [firebird-support] UPDATE MULTI-TABLE
Author Doug Chamberlin
betoban2007 wrote:
> Hi, i need update the fields of a table with data from another table.

If you can update to Firebird 2.1 you can use the new MERGE statement
that makes this MUCH easier. I'm not sure which version it was
introduced in, but I would just update tot he latest version if I were you.

<merge statement> ::=
MERGE
INTO <table or view> [ [AS] <correlation name> ]
USING <table or view or derived table> [ [AS] <correlation name> ON
<condition>
[ <merge when matched> ]
[ <merge when not matched> ]

<merge when matched> ::=
WHEN MATCHED THEN
UPDATE SET <assignment list>

<merge when not matched> ::=
WHEN NOT MATCHED THEN
INSERT [ <left paren> <column list> <right paren> ]
VALUES <left paren> <value list> <right paren>