opal-tools
opal-tools copied to clipboard
implementing prompting for variables in sql scripts
When running sql scripts with SQLplus or SQLcl you can define variables in the script and you will be prompted for them, e.g.:
define LABEL=&&1
select user "&&LABEL." from dual;
This is currently not supported. But it should be.
It is more difficult than expected. But in the code I can put the values into a HashMap, sqlcl will then process it.
Looked at the sample code here: https://github.com/oracle/oracle-db-tools/blob/master/sqlcl/examples/customAccept.sql
Had a conversation with Kris Rice on the topic: https://twitter.com/daust_de/status/1485546387311845378