This function returns a date member value.
Syntax
APEX_JSON.GET_DATE ( p_path IN VARCHAR2, p0 IN VARCHAR2 DEFAULT NULL, p1 IN VARCHAR2 DEFAULT NULL, p2 IN VARCHAR2 DEFAULT NULL, p3 IN VARCHAR2 DEFAULT NULL, p4 IN VARCHAR2 DEFAULT NULL, p_default IN DATE DEFAULT NULL, p_format IN VARCHAR2 DEFAULT c_date_iso8601, p_values IN t_values DEFAULT g_values ) RETURN DATE;
Parameters
Table 20-9 GET_DATE Function Parameters
Parameter | Description |
---|---|
|
Index into |
|
Each %N in |
|
The default value if the member does not exist. |
|
The date format mask. |
|
Parsed JSON members. The default is |
Returns/Raised Errors
Table 20-10 GET_DATE Function Returns and Raised Errors
Return | Description |
---|---|
|
.Returns the date. |
|
Raises this error if |
Example
This example parses a JSON string and prints the value at a position.
DECLARE j apex_json.t_values; BEGIN apex_json.parse(j, '{ "items": [ 1, 2, { "foo": "2014-04-29T10:08:00Z" }] }'); dbms_output.put_line(to_char(apex_json.get_date(p_path=>'items[%d].foo',p0=>3, p_values=>j), 'DD-Mon-YYYY')); END;
Parent topic: APEX_JSON