This content has been marked as final. Show 24 replies
OK - I see you have updated a previous post and I can see what you are trying to do.
As long as you got a value in the debug message, you can now try Paul's method to put the code into an execute immediate statement. Try it just on the f04 item first - so that you are just converting your existing code to get the same result in the debug message as you did using normal PL/SQL. Once that works, you can expand the code to add in your other statements
Final code is this:
The mistake I mentiond was, that I assigned "x" a wrong value.
execute immediate 'begin :1 := apex_application.g_f' || to_char(x, 'fm09') || '(:2); end;' using out v_test, i;
Because I'm having some hidden items before this dynamic one, and another dynamic right behind, I had to do something like "(x*2)+2" (and for second dynamic one "(x*2)+3").
If desired, I could upload it on apex.oracle.com...
But as warning, it's very confusing and far away from beeing error-free :D
Hm... how should I explain it...
I'm trying to build up a table with an unknown amount of columns.
The first six ones are fix, but everything beyond is defined by user.
There are two "types" of columns, the user can choose.
The first "option" consits of two dynamic items, the second of one.
Trying it with some other exaples.
The "end" of the table (where "end" means every column, excepting the first six) might look like this, if user choose four columns of "type 1" and five columns of "type 2"
But user could also choose every other combination, up to g_f50...
case when x = 1 then v_stunden := apex_application.g_f04(i); /* type 1 */ when x = 2 then v_stunden := apex_application.g_f06(i); /* type 1 */ when x = 3 then v_stunden := apex_application.g_f08(i); /* type 1 */ when x = 4 then v_stunden := apex_application.g_f10(i); /* type 1 */ when x = 5 then v_stunden := apex_application.g_f11(i); /* type 2 */ when x = 6 then v_stunden := apex_application.g_f12(i); /* type 2 */ when x = 7 then v_stunden := apex_application.g_f13(i); /* type 2 */ when x = 8 then v_stunden := apex_application.g_f14(i); /* type 2 */ when x = 9 then v_stunden := apex_application.g_f15(i); /* type 2 */ else null; end case;
Just three columns of type 1, just one of type 2... everything.
And a "good" programmer doesn't hardcode something like this :D