1
2
3
4
5
SELECT line,text FROM ALL_SOURCE
WHERE TYPE='PROCEDURE'
AND NAME='过程名称'
AND OWNER='用户名'
ORDER BY line
存储过程分成多行,每一行会存储为一条数据,所以,查询出来的会是多行,line表示行号。
ALL_SOURCE 表中还存储了以下类型信息:
1
2
3
4
5
6
7
8
9
10
SQL>select distinct type from all_source
TYPE
------------
TYPE (对象)类型
TYPE BODY 类型体
PROCEDURE <a href="https://www.baidu.com/s?wd=%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1dWrjmvuWfvrycYrAmzuH7B0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnW6srHTsrjnz" target="_blank" class="baidu-highlight">存储过程</a>
FUNCTION 函数
TRIGGER <a href="https://www.baidu.com/s?wd=%E8%A7%A6%E5%8F%91%E5%99%A8&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1dWrjmvuWfvrycYrAmzuH7B0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnW6srHTsrjnz" target="_blank" class="baidu-highlight">触发器</a>
PACKAGE 包
PACKAGE BODY 包体
create or replace procedure p_cnt(p_time in varchar2,---查询的条件
p_cur out SYS_REFCURSOR)---游标返回
IS
v_sql varchar2(1000) :=''
v_date varchar2(20)
BEGIN
v_date := replace(p_time, '-', '')---时间的格式转换
v_sql := 'select * from dapartment d where d.d_time ='''|| v_date||''''
END
OPEN p_cur FOR v_sql
END p_cnt
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)