3 Replies Latest reply on Feb 19, 2017 10:29 PM by John Snyders-Oracle

    apex 5.1 Interactive Grid Master Detail - Bug

    Alex_K1

      Hi All,

       

      I tested the IG Master Detail demo of the Pre-Packaged Demo App and I noticed an issue. When creating a new entry in the Master IG I receive an error message:

      Ajax call returned server error ORA-06502: PL/SQL: numeric or value error: character to number conversion error ORA-06512: at "APEX_050100.WWV_FLOW_INTERACTIVE_GRID", line 1513 ORA-06502: PL/SQL: numeric or value error: character to number conversion error for .

       

      Does this also happen to others? Is this a known issue?

       

       

      cheers,

      Alex

        • 1. Re: apex 5.1 Interactive Grid Master Detail - Bug
          KlausB

          Hi,

           

          I got the same error, it occurs in the demo app as well as in my own app.

           

          Debugging shows:

           

          CGI: PATH_INFO = /wwv_flow.ajax

           

          HTTP://xyz:8081/apex

          QUERY_STRING=

          REQUEST_METHOD=POST

          REMOTE_ADDR=xxx.xxx.xxx.xxx

          REMOTE_USER=ANONYMOUS

          APEX_LISTENER_VERSION=

          REFERER=

          HTTP_IF_MODIFIED_SINCE=

           

          Cookies: _ga=GA1.2.1469653621.1484301978; ORA_WWV_RAC_INSTANCE=1; LOGIN_USERNAME_COOKIE=samples_admin

           

          Error: Ajax call returned server error ORA-06502: PL/SQL: numeric or value error: character to number conversion error

          ORA-06512: at "APEX_050100.WWV_FLOW_INTERACTIVE_GRID", line 1513

          ORA-06502: PL/SQL: numeric or value error: character to number conversion error for .

           

          - is_internal_error: true

           

          - apex_error_code: APEX.AJAX_SERVER_ERROR

           

          - ora_sqlcode: -6502

           

          - ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character to number conversion error

          ORA-06512: at "APEX_050100.WWV_FLOW_INTERACTIVE_GRID", line 1513

          ORA-06502: PL/SQL: numeric or value error: character to number conversion error

           

          - error_backtrace: ORA-06512: at "APEX_050100.WWV_FLOW_INTERACTIVE_GRID", line 1513

          ORA-06512: at "APEX_050100.WWV_FLOW_INTERACTIVE_GRID", line 3952

          ORA-06512: at "APEX_050100.WWV_FLOW_INTERACTIVE_GRID", line 8463

          ORA-06512: at "APEX_050100.WWV_FLOW_INTERACTIVE_GRID", line 9021

          ORA-06512: at "APEX_050100.WWV_FLOW_REGION_NATIVE", line 3095

          ORA-06512: at "APEX_050100.WWV_FLOW_PLUGIN", line 2144

          ORA-06512: at "APEX_050100.WWV_FLOW_PLUGIN", line 3004

          ORA-06512: at "APEX_050100.WWV_FLOW", line 3332

           

          - component: APEX_APPLICATION_PAGE_REGIONS Employees (849271536475180867)

           

          Cheers,

          Klaus

          1 person found this helpful
          • 2. Re: apex 5.1 Interactive Grid Master Detail - Bug
            user12027001

            Hi, i have the same issue.

            As i seen in debug info, the problem, is when you have in master region a field of type NUMBER and default with a sequence; and this field, is a master field in detail region.

            When you create a new row, this field is populated with a text (t10001) instead a number, and the detail region try to execute the query using that text. This is generating the character to number error.

             

            However, i didn't find yet a way to change this default value to a number.

            Hope this help someone find a solution for this problem.

            • 3. Re: apex 5.1 Interactive Grid Master Detail - Bug
              John Snyders-Oracle

              Hi Alex,

              Thanks for reporting this (and same to others that have also reported it). I have confirmed this and entered bug 25581052 to track it.

               

              The error comes from the detail grid trying to fetch data for the newly added row. It could be argued that the detail IG shouldn't bother because how could there be any records on the server yet. That may end up being the best fix (don't fetch when master row inserted). As pointed out above the error comes from using the temporary client side generated key (such as t1001). The model does allow configuring the prefix used for temporary keys.

               

              Until this is fixed here are some ideas for workarounds.

               

              As has been pointed out elsewhere this error can be ignored and the new master record saved. Unfortunately because of the error you can't enter detail records until the master is saved. And users will be alarmed by the error.

               

              One person has already found that using ROWID got around the problem. I did not confirm this and it probably isn't an acceptable solution for everyone.

               

              You can set the client side model generated key prefix with the following code added to page attribute Function and Global Variable Declaration.

              (function($) {

              // need to do this here (func and global var decl) rather than in Execute when Page Loads so that the handler

              // is setup BEFORE the IG is initialized otherwise will miss the first model created event

              $(function() {

                  var region$ = $("#dept");

                  // the model gets released and created at various times such as when the report changes

                  // listen for model created events so that we configure the model

                  region$.on("interactivegridviewmodelcreated", function(event, ui) {

                      var sid, model = ui.model;

                      if ( ui.viewId === "grid" ) {

                          model.setOption("genIdPrefix", "0"); // or try empty string ""

                      }

                  });

              });

              })(apex.jQuery);

               

              This will remove the error when fetching the detail IG and it allows entering detail records.

              However, this may lead to unique constraint errors depending on how the table assigns primary keys.

               

              In combination with changing the prefix, you may also be able to add a server process that runs before or in place of the default IG DML process that modifies the temp generated primary key before inserting.

               

              Regards,

              -John

              1 person found this helpful