17,082
社区成员
发帖
与我相关
我的任务
分享
-- 大概这样用
SQL>
SQL> create type list_type is table of varchar2(10)
2 /
Type created
SQL> set serverout on
SQL> declare
2 id_list list_type := list_type();
3 rscount int ;
4 begin
5 id_list.extend();
6 id_list(1) :='xx';
7 id_list.extend();
8 id_list(2) :='yy';
9 select count(*) into rscount from table(id_list) where column_value = 'xx';
10 dbms_output.put_line('rscount=' || rscount);
11 end ;
12 /
rscount=1
PL/SQL procedure successfully completed
SQL> drop type list_type
2 /
Type dropped
SQL>