Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: UNIX-Oracle script interface help

Re: UNIX-Oracle script interface help

From: George Dau <gedau_at_isa.mim.com.au>
Date: Tue, 08 Dec 1998 22:06:17 GMT
Message-ID: <366ea250.154713926@isappp>


sybaseuser_at_hotmail.com wrote:

]In my shell script I have:
]
]#!/bin/ksh
]
]LOGNAME=testid
]PASSWORD=testpw
]SPOOL_FILE=./test.log
]
]sqlplus -s $LOGNAME/$PASSWORD <<!
]spool $SPOOL_FILE
]set heading off
]set linesize 300
]
]select 'E1', a.sls_org_cd, a.dist_chnl_cd,
] a.doc_crncy_cd, a.cust_grp_cd, a.matl_cd,
] b.matl_nm
]from table_a a, table_b b
]where a.matl_id = b.matl_id;
]
]spool off
]!
]
]echo "TEST"
]
]
]Somehow the last line: echo "TEST" is being treated as a Oracle command and
]fed into Oracle and I got the following message in my output:
]
]unknown command beginning "echo "TEST"" - rest of line ignored.
]For a list of known commands enter HELP and to leave enter EXIT.
]
]I though the ! sign was sufficient to tell Oracle to exit the SQLPlus session
](this is how it is done in Sybase). If I put "exit" before the ! sign then
]the entire UNIX script exits right there and the echo "TEST" statement
]doesn't get executed at all.

No the ! is only part of the "here document" you started with the <<! on the sqlplus call line. You need to exit Oracle. Change the end of the Oracle script to:

spool off;
exit;
!
echo "TEST"

I suspect you had the "exit" after the ! when you said it exited the script...

--

 ,-,_|\   George Dau,                                             __
/    * \  Unix (Solaris, DEC Unix, Linux), Oracle, Internet.     (OO)
\_,--\_/  Home: gedau_at_pobox.com      Work: gedau_at_isa.mim.com.au ( \/ )
      v   WWW:  http://pobox.com/~gedau                          W--W

MIM Internet policy item 3.4 compliance - "I am clearly stating that any views or opinions expressed above do * NOT * necessarily represent the views or opinions of MIM." Received on Tue Dec 08 1998 - 16:06:17 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US