Sqlplus removes \ r \ n \ t from coil

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.

+3
source share
2

, SQLPlus. SQLPlus - .

SQL , , .

EDIT DCookie: OP , /CHR ( OP, 8i), dpbradley , . :

TRANSLATE Oracle 8:

SELECT TRANSLATE(L,'A'||CHR(10)||CHR(9)||CHR(13),'A') FROM test;
+3

,

SET TAB OFF

?

0
source

Source: https://habr.com/ru/post/1749215/


All Articles