Pl sql updating tables from another table

If the item already exists, instead update the stock count of the existing item.

Alternately, for languages which support cursors, you would declare a cursor on t2 that retrieves the desired values and the key value, then execute an update statement like this: update table 1 set f1 = If t2 is a small lookup table and you want to preselect the rows from table1, you can open a cursor on table1 for update, execute a separate select on t2 to get the desired fields, then do an update where current of cursor.What I want to do is either insert only the new rows, or insert the new rows and update the changed rows (depending on the scenario). If I want to insert only the rows that will not violate the unique index, I can: Which method to use largely depends on requirements.If the software must support multiple database backends or versions, perhaps the generic, standard queries are the best bet.Problem: How can I update multiple fields in table1 with fields from table2?Solution: *********************************************************************************** Note: The information in this document refers to all versions of Inter Base.

Leave a Reply