tags:

views:

2049

answers:

4

I've tried this, but it doesn't work:

col * format a20000

Do I really have to list every column specifically? That is a huge pain in the arse.

+1  A: 

You are in SQL Plus, I presume?

If so, you may want to output your long results to a file.

JosephStyons
+4  A: 

Never mind, figured it out:

set wrap off

Which I found by:

show all

And looking for some option that seemed relevant.

someguy
cool, didn't know that one. I spend most of my time in Toad though.
JosephStyons
Scratch that, wrap set to off does disable the wrap. But now the line is being truncated. $%*!
someguy
Okay, figured this out (again): set wrap off set linesize 3000 // or something very largeUgh.
someguy
@someguy, you should edit your answer above to include the correct syntax
Theresa
+1  A: 

I use a generic query I call "dump" (why? I don't know) that looks like this:

SET NEWPAGE NONE
SET PAGESIZE 0
SET SPACE 0
SET LINESIZE 16000
SET ECHO OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET TERMOUT OFF
SET TRIMOUT ON
SET TRIMSPOOL ON
SET COLSEP |

spool &1..txt

@@&1

spool off
exit

I then call SQL*Plus passing the actual SQL script I want to run as an argument:

sqlplus -S user/password@database @dump.sql my_real_query.sql

The result is written to a file

my_real_query.sql.txt

.

Patrick Cuff
A: 
set wrap off 
set linesize 3000   // or something very large

Lame.

someguy