please help with cast function

please help with cast function

 

  

I need to make a variable inlist. cant quite get this to work. any ideas?

below is not the functionality i need it for. Im just trying to figure out how to do a cast function. any ideas?

1 declare
2 type mytable is table of number;
3 ltable mytable;
4 myval number;
5 cursor crid is
6 SELECT col_id
7 FROM tab1
8 WHERE col2 = 1111;
9 begin
10 for rid in crid loop
11 ltable.extend;
12 ltable(ltable.count) := rid.col_id;
13 dbms_output.put_line(ltable.count);
14 end loop;
15 select count(*)
16 into myval
17 from tab2
18 where my_id in
19 ( select *
20 from THE (select cast (ltable as mytable)
21 from dual)a );
22 dbms_output.put_line(myval);
23* end;
ORACLE>/
from THE (select cast (ltable as mytable)
*
ERROR at line 20:
ORA-06550: line 20, column 25:
PLS-00382: expression is of wrong type
ORA-06550: line 15, column 1:
PL/SQL: SQL Statement ignored

Oracle LazyDBA home page