APEX 4.1
Using an Interactive report, when I try to insert data into a table (Distribution table with ID as primary key), I get the following error
Could not set GLOBALVARS ORA-06502: PL/SQL: numeric or value error: character to number conversion error
I debugged the application and saved a log of the activity. I highlighted the error in RED.
0.07397 0.00126 Session State: Save form items and p_arg_values 4
0.07523 0.00109 ...Session State: Save "P47_SMAPPROVER" - saving same value: "" 4
0.07632 0.00094 ...Session State: Save "P47_PROTOCOLNUMBER" - saving same value: "CQAB149B9999" 4
0.07726 0.00092 ...Session State: Save "P47_ID" - saving same value: "12746" 4
0.07818 0.00976 ...Session State: Save "P47_CTLAPPDATE" - saving same value: "" 4
0.08794 0.00099 ...Session State: Save "P47_ORIGIN" - saving same value: "ICPR" 4
0.08892 0.01919 ...Session State: Save "P47_ORIGIN_T" - saving same value: "" 4
0.10811 0.00080 Processes - point: ON_SUBMIT_BEFORE_COMPUTATION 4
0.10891 0.00138 ...Process "Set GLOBALVARS" - Type: PLSQL 4
0.11030 0.00239 ...Execute Statement: begin begin GLOBALVARS.GUSID := :GUSID; GLOBALVARS.GUSER := :GUSER; GLOBALVARS.GROLE := :GROLE; GLOBALVARS.GUSERID := :USERID; end; end; 4
0.11269 0.00104 Add error onto error stack 4
0.11373 0.00095 ...Error data: 4
0.11468 0.00093 ......message: Could not set GLOBALVARS; 4
0.11561 0.00093 ......additional_info: ORA-06502: PL/SQL: numeric or value error: character to number conversion error 4
0.11654 0.00096 ......display_location: ON_ERROR_PAGE 4
0.11750 0.00099 ......is_internal_error: false 4
0.11849 0.00093 ......ora_sqlcode: -6502 4
0.11942 0.00094 ......ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character to number conversion error 4
0.12036 0.00095 ......error_backtrace: ORA-06512: at "SYS.WWV_DBMS_SQL", line 904 ORA-06512: at "APEX_040100.WWV_FLOW_DYNAMIC_EXEC", line 618 ORA-06512: at "APEX_040100.WWV_FLOW_PROCESS", line 128 4
0.12131 0.00096 ......component.type: APEX_APPLICATION_PROCESSES 4
0.12227 0.00111 ......component.id: 1113626474420504307 4
0.12338 0.00124 ......component.name: Set GLOBALVARS 4
0.12461 0.00099 ...Show Error on Error Page 4
0.12560 0.00528 ......Performing rollback 4
0.13088 0.00215 Processes - point: AFTER_ERROR_HEADER 4
0.13303 0.00226 Processes - point: BEFORE_ERROR_FOOTER 4
0.13529 - End Page Processing
There is a package in Database called GLOBALVARS that sets the variables.
The variables of the package are
GUSID number;
GUSERID varchar2(20);
GUSER varchar2(60);
GROLE varchar2(30);
The session variables are set as
GUSID – (This is the id) (12371) GUSERID – DM_USERID GUSER – USERNAME GROLE – DM
I cannot disable this GLOBALVARS as it is used by a lot of process
Can you please advise how I can get through this error
:GUSID
a page or application variable? Try to place this in your debug log (apex_debug.message) to make sure, or take a look at the session info before submitting. If it is a number, try to do an explicitTO_NUMBER
before setting it. - Tom&12371.
? - Tom