select table function with a dynamic parameter input ?
I have a ok running 'select Table function'
and want to substitute the function parameter
by another sql select:
select * from TABLE ( MY_DB_PACK.f_get_table_values( param => 'have_an_input_parameter_here_from_sql' ));
to show it in exsamples:
#1
the singe select is like this:
sql>
select param_1 , val_1, val_2
from TABLE ( MY_DB_PACK.f_get_data_from_large_table( p_param_1 => 'ABC' ) );
;
'ABC', 12345, 23456
'ABC', 34567, 56789
.....
this is running well
#2
i can substitute the function parameter
sql>
var p_param_1 := 'ABC' ;
select param_1, val_1, val_2
from TABLE ( MY_DB_PACK.f_get_data_from_large_table( p_param_1 => :p_param_1 ));
'ABC', 12345, 23456
'ABC', 34567, 56789
.....
this is running well
#3
for using this select table in a view and connect it with other tables
i have to change the function and the select to work in this matter
select t.param_1, t.val_1, t.val_2 , o.param_o
from TABLE ( MY_DB_PACK.f_get_data_from_large_table( ) ) t, other_table o
where t.param_1 = o.param_o
and o.param_o = 'ABC' ;
'ABC', 12345, 23456 , 'ABC'
'ABC', 34567, 56789 , 'ABC'
.....
is running well BUT slow
this needs lot of more time,
because
the param select is not longer inside the table-function
how to do in #3 to substitute / put_in the parameter directly
as in #2 but from another sql/select ?
regards
Norbert