ORA-40478 or ORA-40459 running JSON Generation Functions

(Doc ID 2354511.1)

Last updated on FEBRUARY 21, 2018

Applies to:

Oracle Database - Enterprise Edition - Version 12.2.0.1 and later
Information in this document applies to any platform.

Symptoms

On a 12.2.0.1 database, when using JSON Generation Functions like JSON_OBJECT, JSON_ARRAY, JSON_OBJECTAGG or JSON_ARRAYAGG on JSON data fails with either one of these errors:

SQL> SELECT JSON_OBJECT (
KEY 'json_data' VALUE json_data
)
FROM huge_json_value;
ERROR:
ORA-40478: output value too large (maximum: 4000)

 

SQL>select JSON_OBJECT(
KEY 'objects' VALUE
(SELECT JSON_ARRAYAGG(
JSON_OBJECT(
KEY 'object_type' VALUE object_type,
KEY 'object_name' VALUE object_name
)
)
FROM dba_objects where rownum < 100
)
)
from dual;

ERROR at line 12:
ORA-40459: output value too large (actual: 4034, maximum: 4000)

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms