1

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...

asked Jun 25, 2013 at 6:49
2
  • 1
    I don't think there is such an option. Commented Jun 25, 2013 at 7:42
  • Seems to me too. I read docs and doesn't find any related set command... Commented Jun 25, 2013 at 8:22

1 Answer 1

5

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.
answered Jun 25, 2013 at 8:38
3
  • First set the pause on. SQL> set pause on SQL> set pages 10 pause 'press enter to continue' Commented Jun 2, 2014 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. Commented Jun 18, 2014 at 11:22
  • The problem for me is if i press CTRL+C it exists out of sqlplus completeley Commented Mar 8, 2016 at 13:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.