Still working on manipulating SQL statements. Some are very long (10-20k). I'm using a shell script to read the SQL statements that are stored in a DB2 table and writing the records out to a file on Unix. The records appear to be getting truncated at 8k.
Is there any way for me to avoid the truncation??
fwiw, here's the code:
while (( $fetchrc == 0 )); do
sqlrow=`db2 +cp -x fetch from c1 `
fetchrc=$?
echo "$sqlrow"|tr -s " "
done
There is no standard maximum, although the ARG_MAX constant limits how long a command line can be. Do you get "command line too long" errors when running this script? In this particular case, you can probably simply avoid using echo altogether:
Maybe this doesn't even have to run in a loop at all -- if you can change the db2 invocation to retrieve all lines at once, you can take out the while loop, too.
Hi I am new to shell programming in unix
Please if I can provide help.
I have a file structure of a header record and "N" detail records.
The header record will be the total number of detail records
I need to split the file in 2:
One for the header
Another for all detail records
Could... (1 Reply)
Hi Experts,
I have a Unix csv file which has long records ie the record length is more than 80 so it goes to the next line.So when its in unix though it spans to two or three lines it still counts it as one record.
But what is happening is for the records that are long when i copy it into excel i... (0 Replies)
Hi everyone.
I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this:
ID: 20
Name: X
Age: 19
ID: 21
Name: Z
ID: 22
Email: xxx@yahoo.com
Name: Y
Age: 19
I want to grep records that... (4 Replies)
Hi all,
I'm new in unix scripting and I've a problem with a script... :confused:
I need to read a file, add some fields in the records, and write them in another file, but even when I simply read and write the records, the shell interprets some caracters and the result is that the records... (5 Replies)
Hi All,
I have two files say file1 and file2.
I want to check the number of records in file1 and if its atleast 2 (i.e., 2 or greater than 2 ) then I have to check records in file2 .If records in file2 is atleast 1 (i.e. if its not empty ) i have to set some conditions .
Could you pls... (3 Replies)
I have a flat file and need to count no of records in the file less the header and the trailer record.
I would appreciate any and all asistance
Thanks
Hadi Lalani (2 Replies)