Skip to Main Content

Oracle Developer Tools for VS Code

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!

Use bind variables in adhoc sql similar to "execute function/procedure"

Ray007Jun 2 2021

Could the same sort of bind variables be implemented for adhoc scripts as when you execute a procedure or function?
Currently, I may write a script that does

update table1 set col = '&new_val' where id = &id;
update table2 set col = '&new_val' where id = &id;

And when I click run, I get prompted for new_val. Then I get prompted for id. Then I get prompted for new_val. Then I get prompted for id. This sucks...

I'd rather write a script that is more like

update table1 set col = :new_val where id = :id;
update table2 set col = :new_val where id = :id;

And get prompted with a single sheet asking me for values to bind to :new_val and :id. Let me choose the datatypes to bind in and set values....

Comments
Post Details
Added on Jun 2 2021
1 comment
87 views