|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Error message but successfull
Hi
Are there anyone has problem to run sqlplus using here-document? My script are as follows #!/bin/sh echo "I am about to check number of objects in source schema " `$ORACLE_HOME/bin/sqlplus TXX/TXX@HXXX <<HERE Set termout off; Set linesize 500; Set pagesize 0; Set verify off; Set feedback off; exit; HERE` echo "After cehck number of objects in source, the exit code=" $? When i remove the back ticks(before $oracle_home and after here) , it exits directly without executing -echo "After cehck number....." When i do not remove the back tiks, i got sqlplus not found error,but the script continues and the output of my echo "After ...." is 127. Any one encounter this problem before? |
|
#2
|
|||
|
|||
|
Hi
In your version, a) if you leave the back tiks, "<<HERE" is understood as being an argument of sqlplus which does not match the name of an existing file. so "<<HERE" is the unknown file b) if you remove the back tiks, then your "exit;" which is basically supposed to be processed by sqlplus is processed by the shell, that is the reason why it exit totally from the execution process, skipping the echo "After check..." ------------------------------------------------- So I would use a temporary file : #!/bin/sh echo "I am about to check number of objects in source schema " echo " Set termout off; Set linesize 500; Set pagesize 0; Set verify off; Set feedback off; exit; " > temp.sql $ORACLE_HOME/bin/sqlplus TXX/TXX@HXXX @temp.sql echo "After check number of objects in source, the exit code=" $? rm temp.sql ------------------ I hope this help - Ctsgnb - |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Error message but successfull |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|