24.17 JSON Function
This function returns p_string with all special characters escaped.
                  
Syntax
APEX_ESCAPE.JSON (
    p_string  IN VARCHAR2 )
RETURN VARCHAR2;Parameters
Table 24-18 JSON Function Parameters
| Parameter | Description | 
|---|---|
| 
 | The string to be escaped. | 
Returns/Raised Errors
Table 24-19 JSON Function Returns
| Return | Description | 
|---|---|
| 
 | The escaped string. | 
Example
The following example prints this: { "name": "O\u0027Brien"}
declare
    l_string varchar2(4000) := 'O''Brien';
begin
    sys.htp.p('{ "name": "'||apex_escape.json(l_string)||'"}');
end;Parent topic: APEX_ESCAPE