Updating two tables
You can use a database link to update a remote object only if you are using Oracle Database distributed functionality.
If you omit to indicate that Oracle Database prohibits any changes to the table or view that would produce rows that are not included in the subquery.
Target(Employee ID, Employee Name) VALUES(100, 'Mary'); INSERT dbo.
Target(Employee ID, Employee Name) VALUES(101, 'Sara'); INSERT dbo.
Rows in the source are matched with rows in the target based on the join predicate specified in the ON clause. One insert, update, or delete operation is performed per input row.
Depending on the WHEN clauses specified in the statement, the input row might be any one of the following: The combination of WHEN clauses specified in the MERGE statement determines the join type that is implemented by the query processor and affects the resulting input stream.
If you cache the data in a temporary (or in-memory) table on -- Fetch data from the other database server SELECT * INTO #my Temp Table FROM OPENQUERY([DB2], 'SELECT * FROM [My Database On DB2].[dbo].[My Other Table]') -- Now I can join my temp table to see the data SELECT * FROM [My Database On DB1].[dbo].[My Table] tab1 INNER JOIN #my Temp Table tab2 ON tab1. ID Check out the documentation for OPENQUERY to see some more examples. I would definitely use the first method in this specific example, but the second option using A join of two tables is best done by a DBMS, so it should be done that way.When used in the subquery of a DML statement, you can specify this clause in a subquery in the can be a subquery, a column, a function, or a collection constructor.Regardless of its form, it must return a collection value—that is, a value whose type is nested table or varray. For any maintenance privileges like insert update and delete the sub select should not be ? means the FROM clause must contain only one table name or view name.