OPEN_ARRAY Procedure
Opens an array. Call this procedure without providing p_key to open the root array or when within another array, or provide p_key to open an array when within an object.
when creating a new APEX_T_JAVASCRIPT_OBJECT, always begin by calling open_object or open_array without specifying p_key. This step is necessary to initialize the root object or array.
Syntax
MEMBER PROCEDURE open_array (
p_key IN VARCHAR2 DEFAULT NULL );Parameters
| Parameter | Description |
|---|---|
p_key |
An optional key. |
Example
Create an array with various properties.
declare
l_arr apex_t_javascript_object := apex_t_javascript_object();
begin
l_arr.open_array;
l_arr.append( 3432 );
l_arr.open_object;
l_arr.open_array( 'list' );
l_arr.append( 'foo' );
l_arr.append( 'baz' );
l_arr.close_array; -- list
l_arr.close_object;
l_arr.close_array; -- root
sys.dbms_output.put_line( l_arr.to_clob );
end;
Output:
[3432,{"list":["foo","baz"]}]
Parent topic: APEX_T_JAVASCRIPT_OBJECT