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

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

From: CBarr <arathorn101_at_hotpop.com>
Date: 3 Mar 2003 12:16:00 -0800
Message-ID: <969841ec.0303031216.67e204fc@posting.google.com>


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

Relevant code - one of 4 calls - is below.

Received on Mon Mar 03 2003 - 14:16:00 CST

Original text of this message

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