Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

execute immediate with UPDATE with RETURNING clause

SozyJul 2 2010 — edited Jul 2 2010
I would like to update a table that name is not known at run time and also want it return the updated value.

UPDATE unknown_table_name
SET salary = salary * 1.1
WHERE department_id = 100
RETURNING employee_id BULK COLLECT INTO empid_list;

If without requirement of returning clause, we would achieve it with the "execute immediate" but with the returning clause, is it also possible with "execute immediate" ? if possible, could you please show me an example.
If not possible, is there another way to implement a dynamic update statement with returning clause?

Appreciate all responses.

Sozy
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 30 2010
Added on Jul 2 2010
8 comments
1,219 views