Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

In sqlplus from Oracle XE Client 10,
I want to run select * from t_abc where rownum<11 on sqlplus

I planned to save the result into a text file that I can view with a text viewer. I've learned about spool and set pagesize 10000. If each record stays in a single line, reading it in a text editor would be no problem.

However, this doesn't work well as the output I got are broken into many lines each within the command-line window's width. This is not readable at all.

I'm looking for a way that can make each record stay in one line. Or something like \G in mysql. Anyway, it's ok as long as it makes it readable.

share|improve this question

1 Answer 1

Try:

set linesize 200

Or whatever length of line will work to make the output fit on one line per row.

share|improve this answer
    
No, this doesn't work. The output will still wrap at the line length exceeds my terminal window. And the output I got by using the spool command wrap as well. –  Haozhun Jan 27 '11 at 14:47
    
If you've got more data than will fit on a line of your terminal, then there's no way you're going to see all of your data on one line per row. What do you want it to do? Truncate some columns so that it fits on one line? Leave out some columns altogether? –  Mike Scott Jan 27 '11 at 15:17
    
I want it write to a file. I then use a text viewer with scroll bar to view it. –  Haozhun Jan 27 '11 at 15:40
2  
In that case, setting a large enough linesize and spooling the output to a file should work -- it will still wrap on screen, but the file should have one line per row. –  Mike Scott Jan 27 '11 at 15:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.