I have 2 types:
CREATE OR REPLACE TYPE id_type AS OBJECT
(
id NUMBER(19, 0)
);
CREATE OR REPLACE TYPE id_table AS TABLE OF id_type;
And I have a function A(param IN id_table).
Now, if I have another function using first one, how am I supposed to pass the param like that A(SELECT 1 FROM DUAL)? Can I only do it manually creating an id_table var, filling it and then passing to A() function?
You can do something like
It’s not obvious, though, why you have an
id_typein this case. It would seem more logical to simply declareid_tableIt’s also not obvious whether you are really intending to populate the collection by selecting from dual. If you really want to have a single-element collection, you can simply initialize it. I’m guessing, however, that you really intend to populate the collection by querying a table other than
DUALin which case you’d prefer theBULK COLLECT