1 2 Previous Next 24 Replies Latest reply: Jan 10, 2011 4:12 AM by 648421 Go to original post RSS
      • 15. Re: How to assign variable with dynamic page item?
        648421
        It shows value "0".
        Then I'll go for Paul's solution
        • 16. Re: How to assign variable with dynamic page item?
          ATD
          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

          Andy
          • 17. Re: How to assign variable with dynamic page item?
            648421
            I implemented following into my pl/sql block:
              execute immediate 'begin :1 := apex_application.g_f' || to_char(x, 'fm09') || '(:2); end;'
                using out v_test, i;
            but it still throws "ORA-01403: no data found" :(
            • 18. Re: How to assign variable with dynamic page item?
              648421
              Found a mistake...
              Let's see, if I can fix it
              • 19. Re: How to assign variable with dynamic page item?
                fac586
                but it still throws "ORA-01403: no data found"
                Meaning that there's no member of the <tt>apex_application.g_fx</tt> collection at the subscript (<tt>i</tt>) used.
                • 20. Re: How to assign variable with dynamic page item?
                  648421
                  Yeah, got it. :)
                  Thanks a lot for this fantastic help!
                  • 21. Re: How to assign variable with dynamic page item?
                    Binepal
                    can you please post your final code
                    • 22. Re: How to assign variable with dynamic page item?
                      648421
                      Final code is this:
                      execute immediate 'begin :1 := apex_application.g_f' || to_char(x, 'fm09') || '(:2); end;'
                          using out v_test, i;
                      The mistake I mentiond was, that I assigned "x" a wrong value.
                      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
                      • 23. Re: How to assign variable with dynamic page item?
                        fac586
                        But as warning, it's very confusing and far away from beeing error-free
                        You're telling me :-). You lost me at:
                        My problem is, that it also might look like this "when x = 3 then v_var := apex_application.g_f07(i)" or "when x = 3 then v_var := apex_application.g_f06(i)".
                        • 24. Re: How to assign variable with dynamic page item?
                          648421
                          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"
                            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;
                          But user could also choose every other combination, up to g_f50...
                          Just three columns of type 1, just one of type 2... everything.

                          And a "good" programmer doesn't hardcode something like this :D
                          1 2 Previous Next