I have to export data from table into flat file with | delimited. In the ksh file, I am adding below to do this activity.
$DBSTRING contains the sqlplus command and $SQL_STRING contains the SQL query. File is created properly with the data as per SQL command. I am getting white spaces in the columns with its size. I dont want these extra spaces and reduce the size of file. How we can do it without using trim command?
RETVAL=`$DBSTRING <<EOF
SET HEADING OFF
SET SPACE 0
SET PAGESIZE 0
SET PAGESIZE 100
SET LINESIZE 9999 WRAP ON
SET COLSEP "|"
SET FEEDBACK OFF
SET TRIMSPOOL ON
SET TRIMOUT ON
SET TAB OFF
SPOOL $OUTPUTFILE
$SQL_STRING
SPOOL OFF
EXIT;
EOF`
Thanks in advance.