6 Replies Latest reply on Jan 15, 2018 7:12 PM by Jian-cdo

    How many parameters I can pass for htmldb_Get()

    Jian-cdo

      Hello,

       

      I have some code like:  The question how many parameter I can pass by addParam()? 

       

            updateAttr = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=UPDATE_CONSULTANT_ATTRIB',0);

            updateAttr.add('CONSULTANT_ID', consultant_id);

            updateAttr.addParam('f01', arrf02);

            updateAttr.addParam('f02', arrf03);

       

      I've passed 20, when I add it to 21, I got this error:  Do I have to split them into two functions?

      The requested URL /apex/wwv_flow.show was not found on this server</BODY></HTML>

       

      Thanks.

        • 1. Re: How many parameters I can pass for htmldb_Get()
          Alli Pierre Yotti

          Hi,

          htmldb_Get()

           

          In the latest Application Express Release 5.1, htmldb_Get has been formally desupported

           

          Try this way to make your Works

           

          https://apex.oracle.com/pls/apex/germancommunities/apexcommunity/tipp/3341/index-en.html

           

           

          You can pass it more Global Variable and Page Items like so for example

           

           

          /* Show a processing image */
          var lSpinner$ = apex.util.showSpinner();

          apex.server.process("SOME_PROCESS",
             {pageItems: "#P2300_LOV"
             },
             {success: function(pData) {
             /* If the AJAX is successful set the value or the returned items */
             if (pData.success === true){
             /* Loop through the array and set the value of each item */
             for (var i=0; i < pData.items.length; i++){
            apex.item(pData.items[i].id).setValue(pData.items[i].value);
             }
             }
            
             /* Remove the processing image */
            lSpinner$.remove();
             },
            error: function(request, status, error) {
             alert(request.responseText);
            
             /* Remove the processing image */
            lSpinner$.remove();
             }
             }
             );

           

           

          Have also a look here

           

          https://docs.oracle.com/cd/E71588_01/AEAPI/apex-server-namespace.htm#GUID-45B43DB1-9601-4BD6-9B7C-6C41C35BEE49

           

           

          With apex.server.proces you can pass limitless Parameters

           

          Regards

           

          Pierre

          • 2. Re: How many parameters I can pass for htmldb_Get()
            fac586

            Jian-cdo wrote:

             

            I have some code like: The question how many parameter I can pass by addParam()?

            None. The evidence from previous posts suggests that you are using APEX 5.x in which case htmldb_Get is either deprecated or desupported and must not be used.

             

            Whatever you are trying to do can be implemented using dynamic actions or modern, supported, and documented APIs.

            • 3. Re: How many parameters I can pass for htmldb_Get()
              Jian-cdo

              Thanks.  but with apex.server.process, I still need to pass over 20 array to application process while according to the document, pData can have f01-f20 at most (don't care about return value)  If I understand correctly, your example code shows more on how to deal with returned value...

              • 4. Re: How many parameters I can pass for htmldb_Get()
                Jian-cdo

                Your reply doesn't help at all.  If you really want to help, my question is simple now: how to pass over 20 arrays from apex.server.process (or other function) to application process?  Don't tell me to change our design, user request always has their own reason.

                • 5. Re: How many parameters I can pass for htmldb_Get()
                  John Snyders-Oracle

                  Hi,

                  The question "The question how many parameter I can pass by addParam()? " really is a trick question and the best answer is use apex.server.process.

                  The answer to the new question: "how to pass over 20 arrays from apex.server.process (or other function) to application process?" is you can't.  f20 is the max that can be sent to APEX in an ajax request.

                   

                  My recommendation to work around this is to encode as much data as you like as JSON and assign the JSON string to one of the "f" arrays such as f01. Then on the server side gather all the elements of the f01 array into a string and use the APEX_JSON API to access all the data. Other encodings are possible but f01 to f20 is all the arrays that APEX supports.

                   

                  You could also stack the arrays; so concatenate arrf20 and arrf21 and assign to "f20" and store the length of arrf20 in x01 for example.

                   

                  You could make two ajax calls but that would not be as efficient.

                   

                  The quote above from Pierre "With apex.server.proces you can pass limitless Parameters" is a little misleading. The documentation of the apex.server.process function pData argument seems to imply that you can put anything you like in pData and you can in theory but there is currently no supported way to access arbitrary properties from pData/p_json on the server. So leveraging the "f" arrays by cramming more data into them is still the best option.

                   

                  Regards,

                  -John

                  1 person found this helpful
                  • 6. Re: How many parameters I can pass for htmldb_Get()
                    Jian-cdo

                    Quick and dirty way is to convert some array parameter into string, pass them as x01 or application item in apex.server.process, then parse them back into a table in Application Process.