Path: news.easynews.com!newsfeed1.easynews.com!easynews.com!easynews!c03.atl99!chi1.webusenet.com!news.webusenet.com!newsfeed.telusplanet.net!news1.telusplanet.net.POSTED!53ab2750!not-for-mail
Message-ID: <3E63CBD9.A5884871@PresiNET_abc.com>
From: Bricklen <BAnderson@PresiNET_abc.com>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.databases.oracle.misc
Subject: Re: Unix shell script drops chars sent to sqlplus - here document, etc.
References: <969841ec.0303031216.67e204fc@posting.google.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 62
Date: Mon, 03 Mar 2003 21:38:19 GMT
NNTP-Posting-Host: 209.53.156.1
X-Trace: news1.telusplanet.net 1046727499 209.53.156.1 (Mon, 03 Mar 2003 14:38:19 MST)
NNTP-Posting-Date: Mon, 03 Mar 2003 14:38:19 MST
Xref: newsfeed1.easynews.com comp.databases.oracle.misc:94306
X-Received-Date: Mon, 03 Mar 2003 14:38:11 MST (news.easynews.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
>
