I'm trying to use the SQL spool command to set a max record length for the output file I'm spooling to. However, when the data exceeds the max record length, it just wraps the data onto the next record.
I'm looking for a way of stopping it writing the extra record, I just want it to truncate the data at the max record length. I can't see an obvious way to do this, and being new to SQL I can't work out the best way to do it. Any advice would be appreciated. Thanks.
For example:
CLEAR BREAKS
SET HEADING OFF
SET LINESIZE 71
SET ECHO OFF
SET SERVEROUTPUT OFF
SET TERMOUT OFF
SET FEEDBACK OFF
SET PAGESIZE 0
SPOOL D:\Data\outputfile.dat
SELECT *
FROM table_name;
SPOOL OFF
/
EXIT
I'm looking for a way of stopping it writing the extra record, I just want it to truncate the data at the max record length. I can't see an obvious way to do this, and being new to SQL I can't work out the best way to do it. Any advice would be appreciated. Thanks.
For example:
CLEAR BREAKS
SET HEADING OFF
SET LINESIZE 71
SET ECHO OFF
SET SERVEROUTPUT OFF
SET TERMOUT OFF
SET FEEDBACK OFF
SET PAGESIZE 0
SPOOL D:\Data\outputfile.dat
SELECT *
FROM table_name;
SPOOL OFF
/
EXIT

Comment