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...
1 Answer 1
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.
-
First set the pause on. SQL> set pause on SQL> set pages 10 pause 'press enter to continue'emily soto– emily soto2014年06月02日 04:24:51 +00:00Commented 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.Mat– Mat2014年06月18日 11:22:57 +00:00Commented Jun 18, 2014 at 11:22
-
The problem for me is if i press CTRL+C it exists out of sqlplus completeleyziggy– ziggy2016年03月08日 13:55:28 +00:00Commented Mar 8, 2016 at 13:55
set
command...