利用管道在SQL中实现查询分页显示和筛选

 

 分页显示:

[oracle@zytk32 ~]$ echo "desc dbms_sqltune"|sqlplus / as sysdba | more

SQL*Plus: Release 11.2.0.4.0 Production on Sat Sep 24 13:04:17 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> FUNCTION ACCEPT_SQL_PROFILE RETURNS VARCHAR2
 Argument Name            Type            In/Out Default?
 ------------------------------ ----------------------- ------ --------
 TASK_NAME            VARCHAR2        IN
 OBJECT_ID            NUMBER            IN     DEFAULT
 NAME                VARCHAR2        IN     DEFAULT
 DESCRIPTION            VARCHAR2        IN     DEFAULT
--More--

 

筛选:

[oracle@zytk32 ~]$ echo "desc dbms_sqltune"|sqlplus / as sysdba | grep DROP
PROCEDURE DROP_SQLSET
PROCEDURE DROP_SQL_PROFILE
PROCEDURE DROP_TUNING_TASK

 

[oracle@zytk32 ~]$ echo "desc dbms_sqltune"|sqlplus / as sysdba | grep DROP_SQL_PROFILE -A 7    //从匹配字符处开始再往下显示7行
PROCEDURE DROP_SQL_PROFILE
 Argument Name            Type            In/Out Default?
 ------------------------------ ----------------------- ------ --------
 NAME                VARCHAR2        IN
 IGNORE             BOOLEAN         IN     DEFAULT
PROCEDURE DROP_TUNING_TASK
 Argument Name            Type            In/Out Default?
 ------------------------------ ----------------------- ------ --------

 

posted @ 2016-09-24 13:05  珠烁晶莹  阅读(822)  评论(0编辑  收藏  举报