Is there any command sql * plus to remove \r \n, and \tfrom the result set, which comes out in the spool file? That is, "trim" each record?
We used set trim onin the past, but it seems that now there is no need for what is needed. I am trying to avoid calling oracle translate, chr function in sql query.
For instance,
set termout off
set spool somefile.dat
set lin 600
select data from mytable;
set spool off;
exit;
My request returns this
|DATA|
|\n \t\t\t\t\t thisistheactualdata \t\t\t\t\t\t\n|
And I would like to save this in my buffered file
thisistheactualdata
Update
Well, we are done doing something like this.
set tab off;
spool /home/oracle/out.dat
set linesize 20
set termout off
set trim on
select regexp_replace(l,'(\t|\n)','') from test;
spool off;
exit;
But the bad news came: we need to run this in oracle 8, and regexp_replace seems to be unavailable. :(
Thanks in advance.
source
share