首先创建一个表
create table test
(
id number,
value varchar2
)
创建包
create or replace package a_package_name
as
TYPE CursorType is REF CURSOR;
PROCEDURE get_procedure_name
(
v_arg1 number,
v_arg2 varchar2,
refCur_return out CursorType,
v_total_Count out varchar2
);
END;
create or replace package body a_package_name
as
procedure get_procedure_name
(
v_arg1 number,
v_arg2 varchar2,
refCur_return out CursorType,
v_total_Count out varchar2
)
is
numArg1 number := '';
strArg2 varchar2(200) := '';
strSql varchar2(200) := '';
strQuery varchar2(200) := '';
strCondition varchar2(200) := ' where 1=1 ';
Begin
if v_arg1 is not null and length(v_arg1)>0 then
numArg1 := v_arg1;
strCondition := ' '|| strCondition ||' and id = '|| numArg1 ||' ';
end if;
if v_arg2 is not null and length(v_arg2)>0 then
strArg2 := v_arg2;
strCondition := ' '|| strCondition ||' and value = '''|| v_arg2 ||''' ';
end if;
strSql := 'selec * from test '|| strCondition ||' ';
OPEN refCur_return FOR strSql;
strQuery := 'select count(1) from test '|| strCondition ||' ';
EXECUTE IMMEDIATE strQuery INTO v_total_Count;
end get_procedure_name;
end a_package_name;
上面的语句都没问题!!!!!!!!!!!!!!!
之后我在包的存储过程名称上面,右键,点击test,怎么报错呢????????应该怎么调用呢!!!!!
------解决方案--------------------
报什么错呢?
------解决方案--------------------
你不都结贴了么小白。。
http://topic.csdn.net/u/20120725/16/aca710d8-1e3f-4fe1-9dd4-e9b31f8828ee.html