Oracle基础 -- SQLPlus如何查看procedure的内容
2016-05-05 21:48
127 查看
desc procedure可以看到procedure的声明。
那如果要查看procudre的内容呢?
solution:
select text from all_source where name = ‘ABC_GET_CMF' and OWNER='CWUK_YY' order by line;
PROCEDURE abc_get_cmf(
v_account_no NUMBER,
abc_get_cmf_cv IN OUT cv_types.customer_tp)
IS
BEGIN
OPEN abc_get_cmf_cv FOR
SELECT
no_bill,
CMF.currency_code,
prev_bill_date
FROM CMF
WHERE CMF.account_no = v_account_no;
END;
14 rows selected.
我们可以看下all_source这个表的各个字段
SQL> desc all_source;
Name Null? Type
----------------------------------------------------------------------- -------- ------------------------------------------------
OWNER VARCHAR2(30)
NAME VARCHAR2(30)
TYPE VARCHAR2(12)
LINE NUMBER
TEXT VARCHAR2(4000)
SQL> select distinct type from all_source;
TYPE
------------
TYPE BODY
PROCEDURE
LIBRARY
TRIGGER
JAVA SOURCE
PACKAGE
TYPE
FUNCTION
PACKAGE BODY
ALL_SOURCE describes the text source of the stored objects accessible to the current user.
Related Views
DBA_SOURCE describes the text source of all stored objects in the database.
USER_SOURCE describes the text source of the stored objects owned by the current user. This view does not display the OWNERcolumn.
Column
Datatype
NULL
Description
OWNER
VARCHAR2(30)
NOT NULL
Owner of the object
NAME
VARCHAR2(30)
NOT NULL
Name of the object
TYPE
VARCHAR2(12)
Type of object: FUNCTION, JAVA SOURCE, PACKAGE, PACKAGE BODY, PROCEDURE, TRIGGER,TYPE, TYPE BODY
LINE
NUMBER
NOT NULL
Line number of this line of source
TEXT
VARCHAR2(4000)
Text source of the stored object
useful link:https://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_2063.htm#i1588578
那如果要查看procudre的内容呢?
solution:
select text from all_source where name = ‘ABC_GET_CMF' and OWNER='CWUK_YY' order by line;
PROCEDURE abc_get_cmf(
v_account_no NUMBER,
abc_get_cmf_cv IN OUT cv_types.customer_tp)
IS
BEGIN
OPEN abc_get_cmf_cv FOR
SELECT
no_bill,
CMF.currency_code,
prev_bill_date
FROM CMF
WHERE CMF.account_no = v_account_no;
END;
14 rows selected.
我们可以看下all_source这个表的各个字段
SQL> desc all_source;
Name Null? Type
----------------------------------------------------------------------- -------- ------------------------------------------------
OWNER VARCHAR2(30)
NAME VARCHAR2(30)
TYPE VARCHAR2(12)
LINE NUMBER
TEXT VARCHAR2(4000)
SQL> select distinct type from all_source;
TYPE
------------
TYPE BODY
PROCEDURE
LIBRARY
TRIGGER
JAVA SOURCE
PACKAGE
TYPE
FUNCTION
PACKAGE BODY
ALL_SOURCE describes the text source of the stored objects accessible to the current user.
Related Views
DBA_SOURCE describes the text source of all stored objects in the database.
USER_SOURCE describes the text source of the stored objects owned by the current user. This view does not display the OWNERcolumn.
Column
Datatype
NULL
Description
OWNER
VARCHAR2(30)
NOT NULL
Owner of the object
NAME
VARCHAR2(30)
NOT NULL
Name of the object
TYPE
VARCHAR2(12)
Type of object: FUNCTION, JAVA SOURCE, PACKAGE, PACKAGE BODY, PROCEDURE, TRIGGER,TYPE, TYPE BODY
LINE
NUMBER
NOT NULL
Line number of this line of source
TEXT
VARCHAR2(4000)
Text source of the stored object
useful link:https://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_2063.htm#i1588578
相关文章推荐
- oracle dba create view 失败 解决办法
- oracle 参考
- Oracle学习系列2
- Oracle学习系列1
- Centos 5 Oracle 11G 超详细安装
- Centos 6 Oracle 12C 超详细安装
- Oracle 数据库导入导出 dmp文件
- oracle connect by用法篇
- Oracle表空间查看sql使用情况
- Oracle数据库语法之【DDL】常用汇总-【更新】
- oracle中的常用函数
- ORACLE中RECORD、VARRAY、TABLE的使用详解
- oracle 使用BULK COLLECT+FORALL加速批量提交
- Oracle 关键字(保留字) 大全
- Oracle 9i/10g/11g数据库升级路线图总览
- Oracle查看锁表
- 基于SPARK SQL 读写ORACLE 的简单案例分析常见问题
- Centos 7 Oracle 12C 超详细安装
- oracle查询语句大全
- spark读取oracle的