Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Unix shell script drops chars sent to sqlplus - here document, etc.
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.