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.



set linesize 200

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

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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