Skip to Main Content
  • Questions
  • Interactive Grid dynaic action set value giving error if write on first column and primary key column

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Daxesh .

Asked: July 21, 2021 - 9:16 am UTC

Last updated: August 03, 2021 - 11:36 pm UTC

Version: 20.2

Viewed 1000+ times

You Asked

CASE- I
-------
1) to explain problem i use emp dataset. i create another test table using create table emp_test as select * from emp where 1=2;
2) create interactive grid using emp_Test.
3) my first column is empno and that is my primary key
4) i create dynamic action on change of empno.
action type :set value
set type : sql query;
SQL STATMENT: select ename, job, mgr ,sal,comm,deptno from emp where empno = :empno
item to submit :EMPNO
Affected Elements :ENAME,JOB,MGR,SAL,COMM,DEPTNO (selection type columns)

when run and navigate to first column empno giving me following error: Ajax call returned server error ORA-01722: invalid number for Set Value.
from debug page getting : Error: Ajax call returned server error ORA-01722: invalid number for Set Value.
- ora_sqlerrm: ORA-01722: invalid number
ORA-06512: at "APEX_200200.WWV_FLOW_PLUGIN_UTIL", line 1454
ORA-06512: at "APEX_200200.WWV_FLOW_DYNAMIC_EXEC", line 1181
ORA-06512: at "SYS.DBMS_SYS_SQL", line 2120
ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_200200", line 679
ORA-06512: at "APEX_200200.WWV_FLOW_DYNAMIC_EXEC", line 1176
ORA-06512: at "APEX_200200.WWV_FLOW_PLUGIN_UTIL", line 2400
ORA-06512: at "APEX_200200.WWV_FLOW_PLUGIN_UTIL", line 1442

- error_backtrace: ORA-06512: at "APEX_200200.WWV_FLOW_PLUGIN_UTIL", line 1454
ORA-06512: at "APEX_200200.WWV_FLOW_DYNAMIC_EXEC", line 1181
ORA-06512: at "SYS.DBMS_SYS_SQL", line 2120
ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_200200", line 679
ORA-06512: at "APEX_200200.WWV_FLOW_DYNAMIC_EXEC", line 1176
ORA-06512: at "APEX_200200.WWV_FLOW_PLUGIN_UTIL", line 2400
ORA-06512: at "APEX_200200.WWV_FLOW_PLUGIN_UTIL", line 1442
ORA-06512: at "APEX_200200.WWV_FLOW_DYNAMIC_ACTION_NATIVE", line 157

IF I CHANGE EMPNO PROPERTY AND UNSET PRIMARY KEY THAN IT WORKING OKEY. BUT IN CASE OF PRIMARY KEY JUST NAVIGATE TO FIRST COLUMN IT GIVING ME ERROR.

CASE-2
---------
IF I SET TWO COLUMN OF PRIMARY KEY (COMPOSITE PRIMARY KEY) THEN SET VALUE ACTION GIVING ME ERROR AND VALUE I GOT IN ONLY ONE FILED.

IT GIVING ERROR : Error: Ajax call returned server error ORA-01722: invalid number for Set Value.

MORE:- USER REQUIEMENT IN INTERACTIVE GRID NAVIGATE TO NEXT COLUMN USING TAB BUT WISH TO NAVIGATE USING ENTR KEY. HOW WE CHANGE THE KEY MAPPING

I PRODUCE SAMPLE APPLCIATION

workspace name :dax_apex
userid : dax.apex@gmail.com
Passoword: ************
Application 87222
TEST-IG

case - 1 on page no 1
case-2 on page no 2

and Connor said...

Best way for us to help is to create this as an app on apex.oracle.com and then send us some workspace credentials so we can test it out there.

Please ping us back in this question with those details.

=================

I got this information back from APEX dev John Snyders who own IG. Hope this helps


Interactive grid does not support editing primary key columns. The desire to do so is captured in this bug 25593757 - INTERACTIVE GRID CAN'T CHANGE VALUE OF AN EDITABLE PRIMARY KEY COLUMN

I believe the best recommendation is to use ROWID for the primary key column. I believe this is the same for their case 2 composite key.

Another thing may be happening here is that the client side model uses temporary key values for primary key columns on inserted records and these keys are strings that start with the letter “t” by default. This could be the cause of the “invalid number” error. Again using ROWID should solve the issue.

In general using a dynamic action to set values of other columns when a column value changes is fine even using ajax to get values from the server. I try to design an app to avoid extra ajax requests on per cell edits when possible.

It is not possible to change the behavior of enter key so that it moves to the next column in the same row. We feel that the behavior of tab and enter in the grid while editing is customary and expected behavior and it is consistent with the way spread sheets work as well. I have seen one other request to have enter move to the next column. If there is evidence or motivation for this navigation pattern I would like to know what it is to determine if the grid widget should have a mode setting to control tab/enter key navigation.


Is this answer out of date? If it is, please let us know via a Comment

More to Explore

APEX

Keep your APEX skills fresh by attending their regular Office Hours sessions.