oracle-databaseoracle-apexsqlcl

APEX export with SQLcl results in ORA-06502: PL/SQL: numeric or value error


SQLcl: Release 22.3 Production auf Fr. Nov. 04 17:19:43 2022

SQL> apex export -applicationid 1681 Exporting Application 1681

java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error
ORA-06512: in "APEX_220100.WWV_FLOW_EXPORT_API", row 143
ORA-06512: in "APEX_220100.WWV_FLOW_GEN_API2", row 10218
ORA-06512: in "SYS.DBMS_ASSERT", row 493
ORA-06512: in "SYS.DBMS_ASSERT", row 583
ORA-06512: in "APEX_220100.WWV_FLOW_GEN_API2", row 10194
ORA-06512: in "APEX_220100.WWV_FLOW_EXPORT_INT", row 1234
ORA-06512: in "APEX_220100.WWV_FLOW_EXPORT_API", row 81

I did not find anything related to APEX export and ORA-06502 on the web.

Tried switching to SQLcl version to 20.3 and from 21.4 That didn't change anything and I got the same error in these version, too.

It seems to be some environment problem, as co-workers are able to export applications from the same database. When I try to export this application from the APEX App Builder it is working.


Solution

  • The problem is caused by the NLS parameter NLS_NUMERIC_CHARACTERS.

    For switzerland this is ".'", so I guess the ' is the problem here.

    This will resolve the problem:

    alter session set NLS_NUMERIC_CHARACTERS = ',.';