37.51 WRITE Procedure Signature 15
This procedure writes an array attribute of type
sys.xmltype
. The procedure uses a XSL transformation to generate JSON. To determine the JSON type of values, it uses the following rules:
- If the value is empty, it generates a
NULL
value. - If upper(value) is
TRUE
, it generates a boolean true value. - If upper(value) is
FALSE
, it generates a boolean false value. - If the
XPath
number function returns true, it emits the value as is. Otherwise, it enquotes the value (that is, treats it as a JSON string).
Syntax
APEX_JSON.WRITE (
p_name IN VARCHAR2,
p_value IN sys.xmltype,
p_write_null IN BOOLEAN DEFAULT FALSE );
Parameters
Parameter | Description |
---|---|
p_name |
The attribute name. |
p_value |
The value to be written. The XML is converted to JSON |
p_write_null |
If TRUE, write NULL values. If FALSE (default), do not write NULL s.
|
Example
See example for WRITE Procedure Signature 14.
Parent topic: APEX_JSON