1

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.

roaima
  • 107,089
  • 14
  • 139
  • 261
Nir
  • 1,265
  • 7
  • 23
  • 34

1 Answers1

0

Problem is the assigment line, it should be changed to:

exec :a :=${SH_NUM};
Nir
  • 1,265
  • 7
  • 23
  • 34