Procedure aaa(v_strID in Varchar2, Mycs Out Is Ref Cursor)
Is
Begin
Open Mycs For
select * from Table where tableID in (v_strID);
End;
End aaa;
这样写的话查不出来。...
请问v_strID这个字符串在存储过程中要怎么来写呢?
------解决方案--------------------
create or replace package pkg_query
as
type page_result is ref cursor;
procedure pkg_query
(
p_tableid in varchar2,
p_page in out page_result
);
end;
/
create or replace package body pkg_query
as
procedure pkg_query
(
p_tableid in varchar2,
p_page in out page_result
)
is
v_sql varchar2(4000);
begin
v_sql := 'select * from table where tableID in ( '||p_tableid|| ') ';
open p_page for v_sql;
end;
end;
/
其中 p_tableid 请传入 '1 ', '2 ', '3 '或者 1,2,3这样的格式