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!

How to dynamically change the table name for a update statement

DharVMar 11 2011 — edited Mar 11 2011
Hi All,

I need to update a coulumn xyz in either of tables abc and efg based on some condition.

I wrote a cursor which has union of two queries(one querying abc and other efg)

Now based on some inparameter only one will be executed at a time.

And based on some condition a coulumn xyz needs to be updated which is in either of the table.



As the update condition is same

Update abc/efg set xyz=data where condition

I am looking to initialize a variable like v_tname based on some condition and update like

update v_tname .........

(Exactly that may not be like so, But looking a technique like this)

Please help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 8 2011
Added on Mar 11 2011
11 comments
1,015 views