SQL> drop type testa;Type droppedSQL> create type testa is table of varchar2(10); 2 /Type createdSQL> set serverout on;SQL> declare 2 t_test testa := testa('a','b','c'); 3 cnt integer; 4 begin 5 select count(*) into cnt from t where b in (select column_value from table(t_test)); 6 dbms_output.put_line('output:' || cnt); 7 end; 8 /output:3PL/SQL procedure successfully completed
SQL> delete from t where b = 'b';1 row deletedSQL> commit;Commit completeSQL> select b from t;B ----- a c d eSQL> SQL> declare 2 t_test testa := testa('a','b','c'); 3 cnt integer; 4 begin 5 select count(*) into cnt from t where b in (select column_value from table(t_test)); 6 dbms_output.put_line('output:' || cnt); 7 end; 8 /output:2PL/SQL procedure successfully completed
2 /Type createdSQL> set serverout on;SQL> declare
2 t_test testa := testa('a','b','c');
3 cnt integer;
4 begin
5 select count(*) into cnt from t where b in (select column_value from table(t_test));
6 dbms_output.put_line('output:' || cnt);
7 end;
8 /output:3PL/SQL procedure successfully completed
-----
a
c
d
eSQL>
SQL> declare
2 t_test testa := testa('a','b','c');
3 cnt integer;
4 begin
5 select count(*) into cnt from t where b in (select column_value from table(t_test));
6 dbms_output.put_line('output:' || cnt);
7 end;
8 /output:2PL/SQL procedure successfully completed