sqlplus get a TXT file to import using spool

0

I'm working with Oracle Database and I need to create a script that will generate an import file in TXT format. I'm using sqlplus and the spool command to save the queries but for more than try I can not accommodate the data:

What I need is:

1|Retratos de gente|2|DC|4|4
2|Campanas|2|AC|7|5
3|Edificios historicos|2|DC|7|6

But what I get is:

        1|Retratos de gente   |              2|DC
                    4|                   4
        2|Campanas            |              2|AC
                    7|                   5
        3|Edificios historicos|              2|DC
                    7|                   6|T

Is there any way to re-order the data?

    
asked by Darius 28.03.2017 в 20:33
source

1 answer

0

I already solved it, the solution was to separate with two vertical bars each column of the table followed by the separator in quotes:

SQL> select ID_CAS||'|'||DESC_CAS||'|'||ID_TIPO||'|'||ID_TIP||'|'||CANTIDAD||'|'||DIAS FROM CSM.CASUISTICAS;
    
answered by 31.03.2017 / 16:58
source