Hi Damian,
I have removed the backticks and still do not have desired result,because it get out of the code without executing the last script.
If i do not have the exit; it worse, it got error.
For instance the following code(i cat it so it can show the line number).
-----------------------Start of my example---------------------
[shell test]
[shell test]
[shell test]
[shell test] cat -n test.sh
1 #!/bin/sh
2
3
4 echo "I am about to check number of objects in source schema "
5 $ORACLE_HOME/bin/sqlplus TXX/TXX@HXXX <<HERE
6 Set termout off linesize 500 pagesize0 verify off feedback
off;
7 Spool 20030812/srctblcount.log;
8 Select count(*) from user_tables;
9 exit;
10 HERE
11 echo "After cehck number of objects in source, the exit code="
$?
[shell test]
[shell test]
[shell test] ./test.sh
I am about to check number of objects in source schema
SQL*Plus: Release 8.1.7.0.0 - Production on Tue Aug 12 10:57:12 2003
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.7.0.0 - 64bit Production
With the Partitioning option
JServer Release 8.1.7.0.0 - 64bit Production
SQL> SQL> SQL> 4
SQL> Disconnected from Oracle8i Enterprise Edition Release 8.1.7.0.0 -
64bit Production
With the Partitioning option
JServer Release 8.1.7.0.0 - 64bit Production
[shell test]
[shell test]
-----------------------------End of my example--------------
It seems that the following last code was never executed:
echo "After cehck number of objects in source, the exit code=" $?
Do you encounter this before?
Quote:
Originally posted by Damian Ibbotson
Okay. That's your error message when you include the backticks.
Do you get an error message when you remove the backticks or are you just not getting the output you expect?
I'd guess that you probably don't need the 'exit' at all because you are not running SQLPlus interactively. The method you are using will implicitly exit from SQLPlus once it has completed all the actions between EODs. I don't see how its inclusion would affect what you are trying to do though.
Are you expecting the script to end with you in an active SQLPlus session? I'm afraid that's not going to happen.
|