25.31 TO_MEMBER_NAME Function
This function converts the given string to a JSON member name, usable for accessing values via the get_% functions. Unless member names are simple identifiers (A-Z,0-9, "_"), they need to be quoted.
Syntax
FUNCTION TO_MEMBER_NAME (
p_string IN VARCHAR2 )
RETURN VARCHAR2Parameters
Table 25-40 TO_MEMBER_NAME Function Parameters
| Parameter | Description |
|---|---|
|
|
The raw member name. |
Returns
A valid member name for get_% functions.
Example
Print various converted strings.
begin
sys.dbms_output.put_line('Unquoted: '||apex_json.to_member_name('member_name'));
sys.dbms_output.put_line('Quoted: '||apex_json.to_member_name('Hello"World'));
end;
Output:
Unquoted: member_name
Quoted: "Hello\"World"Parent topic: APEX_JSON