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 shell script drops chars sent to sqlplus - here document, etc.

Re: Unix shell script drops chars sent to sqlplus - here document, etc.

From: Bricklen <BAnderson_at_PresiNET_abc.com>
Date: Mon, 03 Mar 2003 21:38:19 GMT
Message-ID: <3E63CBD9.A5884871@PresiNET_abc.com>


I believe it is because of the conversion from dos/windows crlf to unix crlf (or the lack of conversion).

I use ultraedit and there is a converter that converts from dos->unix and back, etc. (I've encountered the problem several times where I had the same error msg).

Try formatting it in emacs/vi if you don't have ultraedit or something comparable.

hth

CBarr wrote:
>
> Does anyone know why this would happen?
>
> Chars are sometimes dropped, resulting in an Oracle error.
>
> This Ksh script runs on a Sun, SunOS 5.7, in the background.
> It connects to a local Oracle 8i (8.1.7) server.
>
> This fails in one out of about 8 sqlplus calls, not always
> the same one (4 are in the script.)
>
> "Pipe to" flavor:
> print "
> ... <sql statements>
> ...
> " | sqlplus
>
> "Here document" flavor:
> sqlplus <<EOF
> ... <sql statements>
> ...
> EOF
>
> I wonder why it fails with obviously garbled input, e.g.
> I wonder about the order-of-operations Korn Shell uses ...
> And - most of all - I wonder about i/o settings on this box,
> for this login, buffering ...
>
> Err msg:
> ERROR at line 12:
> LTRIM(ovtc.carrierpa, ' ') ASr.rrname
> ORA-00923: FROM keyword not found where expected
>
> This is because chars were - apparently - dropped from
> approximately positions 275-495 in the group of strings sent
> to sqlplus.
>
> I.e., dropped text apparently began in the middle of line 12,
> ended in midst of line 19.
>
> This runs in the background, >logfile 2>&1
>
> I know that tcl and expect are preferred tools for this,
> but I've used ksh so many times that I'm inclined to believe
> it can be fixed.
>
> In advance, thanks for any insights,
> Chris Barr

> Received on Mon Mar 03 2003 - 15:38:19 CST

Original text of this message

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