How to deal with long records (> 8k)??

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:

while db2 +cp -x fetch from c1
do
 : nothing
done | tr -s " "

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.