I have
create or replace TYPE t_process_teilenummer_tab AS TABLE OF VARCHAR2(4000);
create or replace FUNCTION process_teilenummer (
Teilenummer IN CLOB
)
RETURN t_process_teilenummer_tab
...some processing which returns a table of strings
so I can now do
SELECT column_value
FROM TABLE(
process_teilenummer('abc , xyz' ) )
and I get a table with one column with 2 rows abc and xyz. of course there is another process involved for example to generate more combination of the inserted value or values as comma separated string.
using the CLOB as IN parameter isn't necessary but before I thought it could take a string literal with more than 4000 characters which us not true because it doesn't matter what is your IN parameter if varchar2(4000) or varchar2(30000) or CLOB you can not exceed 4000 as string literal as far as I know.
So I can use the function as stated above but I would like to insert values from a table as well so instead of 'abc,xyz' etc. it would be fine to take an output from another table with 1 column an 5000 rows an pass it to my table function, it will process what it needs and I can again 1 column with x-rows
You may use Polymorphic Table Function (PTF) introduced in 18c that does exactly what you want: transforms arbitrary input of type result set.
fiddle