Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call sqlplus form unix

Status
Not open for further replies.

zen2003

MIS
Jul 21, 2003
17
US
I am calling a sqlplus script from a shell script. I get an error on the size of the string I am passing as a parameter. Can someone help me on how I can solve this.

Error is:
string beginning "UNH+000000..." is too long. maximum size is 239 characters.

Line that gives error:
UNH+00000000011626+XCXCXC:D:96A:UN:NH4402'BGM+XZ8+2'DTM+137:20030424:102'LIN+1'RFF+XC3:ASDD2003-04-24-09.50.24.765263'RFF+AEK:03042409500005'RFF+CR:LRBC8662'SEQ++1'GIS+2'FTX+ACB+++CREDIT BANK ID MISSING - TRANSFER REJECTED. EDIT ERROR.'UNT+11+00000000011626'


This line does not give error:
UNH+00000000011625+XCXCXC:D:96A:UN:NH4402'BGM+XZ8+1'DTM+137:20030424:102'LIN+1'RFF+XC3:ASDD2003-04-24-09.50.24.765263'RFF+AEK:03042409500007'RFF+CR:LRBG1219'SEQ++1'GIS+2'FTX+ACB+++MOD CHECK ON RDFI-ID FAILED'UNT+11+00000000011625'

Shell Script that calls sqlplus:
#!/bin/sh

awk -f zen.awk zen.txt | while read theLine
do
line1=`echo $theLine | sed "s/'/|/g"`
line2=`echo $line1 | sed "s/[ ]/||/g"`
echo "line is -> [$line2]"
sqlplus -s a/a @load1.sql $line2
done


 
Is that an Oracle error? If so, give the full error message. There are usually an alpha and a numberic code that lets you look up more detail.

As far as the size limitation, it's probably an Oracle limit, not a shell or unix limit, so the xargs may not help (it might tho).

Looking at the size of the two sample records, the one that doesn't work is 257 bytes long. The one that does work is 231 bytes long. You appear to be loading it, how is the column you're loading it into defined?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top