21.50 WRITE Procedure Signature 17

This procedure writes an array attribute of type VARCHAR2.

Syntax

procedure write (
      p_name        in varchar2,
      p_values      in apex_t_varchar2,
      p_write_null  in boolean default false );

Parameters

Table 21-59 WRITE Procedure Parameters

Parameter Description

p_name

The attribute name.

p_values

The VARCHAR2 array values to be written.

p_write_null

If true, write an empty array. If false (the default), do not -- write an empty array.

Example

This example writes an array containing a, b, c.

declare
 l_values apex_t_varchar2 := apex_t_varchar2( 'a', 'b', 'c' );
begin
  apex_json.open_object;                -- {
  apex_json.write('array', l_values );  --   "array": [ "a", "b", "c" ]
  apex_json.close_object;               -- }
end;