oracle 游标 返回查询结果集
--声明包头
CREATE OR REPLACE PACKAGE gh_check
AS
TYPE gh_cursor IS REF CURSOR;--这个是游标
PROCEDURE gh_check(DWMC in VARCHAR2, LX in VARCHAR2,--这个是过程
P_CUR OUT gh_check);
END gh_check;
--声明包体
CREATE OR REPLACE PACKAGE BODY gh_check
AS
PROCEDURE sp_test1(DWMC in VARCHAR2, LX in VARCHAR2,
P_CUR OUT TESTCUR) is
strsql varchar2(1000);
begin
strsql:='select * from test_table where dwmc=:dwmc and lx=:lx';
open p_cur for strsql using dwdc,lx;--上一句的:及这一句为绑定变量
end sp_test1;
end gh_check;