Calling a shell script from within sqlplus is buggy…
I have reported bug 3798918 in 10.1.0.2 (back in 2004) and bug 13349119 in 188.8.131.52 because some metalink guru closed 3798918 as not reproducible.
As written in return code, host does not return the correct code
SQL> host exit 7 SQL> def _RC DEFINE _RC = "0" (CHAR)
If you never use _RC, you may believe you are safe. But watch this :
SQL> get foo.sh list 1 #!/bin/sh 2 if /bin/false 3 then 4 echo this is wrong 5* fi SQL> host ./foo.sh this is wrong
The return code not being set is not only affecting the _RC variable, but it is also affecting all subshells !
Note this is not reproducable with SQLPLUS /NOLOG
SQL> host false SQL> def _rc DEFINE _RC = "1" (CHAR) SQL> conn x/x ERROR: ORA-01017: invalid username/password; logon denied SQL> host false SQL> def _rc DEFINE _RC = "0" (CHAR)
After my (failed or successfull) tentative to connect as x/x, it is reproducible again