Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I stop using SQL Developer as found more convenient to use SQL Plus inside Emacs SQLi mode.

SQL Developer on selects with large amount of rows show only few rows. But SQL Plus tend to dump all rows that match conditions. I can put ROWNUM <= N but I often forget to do this.

Is there any option for SQL Plus to limit it output from select statement? I will put it to /opt/instantclient/glogin.sql in order to apply to each sesstion...

share|improve this question
1  
I don't think there is such an option. –  a_horse_with_no_name Jun 25 '13 at 7:42
    
Seems to me too. I read docs and doesn't find any related set command... –  gavenkoa Jun 25 '13 at 8:22

1 Answer 1

up vote 5 down vote accepted

I don't think you can. The only thing I know that sort of does that (but is slightly annoying IMO) is the PAUSE option which waits for you to press enter between pages. The annoying part is that it pauses before the first row... You can Ctrl C to interrupt when you've seen enough.

SQL> set pause on
SQL> set pages 10 pause 'press enter to continue'
SQL> select object_name from dba_objects;
press enter to continue

OBJECT_NAME
--------------------------------------------------------------------------------
ICOL$
I_USER1
CON$
UNDO$
C_COBJ#
I_OBJ#
PROXY_ROLE_DATA$
press enter to continue

OBJECT_NAME
--------------------------------------------------------------------------------
I_IND1
I_CDEF2
I_OBJ5
I_PROXY_ROLE_DATA$_1
FILE$
UET$
I_FILE#_BLOCK#
press enter to continue

I_FILE1
ERROR:
ORA-01013: user requested cancel of current operation

15 rows selected.
share|improve this answer
    
First set the pause on. SQL> set pause on SQL> set pages 10 pause 'press enter to continue' –  emily soto Jun 2 at 4:24
    
Thanks @emily. Wasn't necessary on the system I tried that at first, but just came upon one where it was. Edited accordingly. –  Mat Jun 18 at 11:22

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.