Hi Friends,
I have got requirement in which I want to pass the table OUTPUT having different set of columns in stored procedure depending on the column names as INPUT to the procedure.
Say example if I pass column names as an input to the procedure then only those column names should go as output as Table from my procedure. If user passes col1,col2, and col5 as input parameter then output table will have col1, col2 and col5 only part of table output.
In the next go, if user passes col1....col100 then my output table will have all the col1....col100 columns in my table output. All these columns as input will come from UI.
Selected columns from UI will go as an input into my stored procedure import parameters. I created dynamic SQL query based on that but how can I pass to output container, I am stuck in that part.
I tried with table type but it looks not possible as I need to drop and create the same table type at runtime and also that same table type is also used in output parameter of the same procedure, so it gives me cyclic error.
Is there any other way you guys can think of ? Please share.
Thanks,
Gaurav
HDB 2.0 SP3