I wish to execute DMLs using bind variable with shell scripts.
For example, something like:
#!/bin/bash
SH_NUM=10
sqlplus -S test_user/test_pass <<EOD
var a number;
a:=${SH_NUM}
insert into test_table values(a);
commit;
EOD
I'm not sure if this is possible, I can use this approch when using pl/sql but I wish to know if I can do it this method as well.
Best Answer
Sure it is possible:
Execute it (I just put
DBMS_XPLAN.DISPLAY_CURSOR
in there to see the last statement executed):