Error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Location: Shared Components → Report Queries → Edit → Source Queries
Problem: After upgrading from APEX 22.1 to 24.2, queries over 4000 chars with multibyte characters (like '☒') crash the Application Builder.
Root Cause: Someone modified the wwv_flow_report_query_dev.GET_DISPLAY_NAME
function and used:
...
L_DISPLAY_NAME VARCHAR2( 4000 );
...
L_DISPLAY_NAME := SYS.DBMS_LOB.SUBSTR( P_SQL_QUERY, 4000 )
This tries to fit 4000 characters (potentially 12,000 bytes) into a VARCHAR2(4000) variable. Basic Oracle mistake.
Impact: Application Builder unusable for international queries. This worked perfectly in 22.1.
Fix: Either increase buffer size to VARCHAR2(32767) or use proper byte handling.
This is an unacceptable regression that breaks existing functionality. How did this pass QA without testing multibyte character sets?
Environment: APEX 24.2, Oracle 19c, AL32UTF8, 8000+ char queries
Demand immediate hotfix.