{ [TD_SYSFNLIB.] ARRAY_TO_JSON (ARRAY_expr) |
( [TD_SYSFNLIB.] ARRAY_TO_JSON (ARRAY_expr) RETURNS returns_clause )
}
Syntax Elements
- returns_clause
{ data_type [ ( integer ) ] [ CHARACTER SET { UNICODE | LATIN } ] |
STYLE column_expr
}
- You can use the RETURNS clause to specify the maximum length and character set of the JSON type.
- If you do not specify a RETURNS clause, the return type defaults to JSON data type with UNICODE character set and a return value length of 64000 bytes, which supports up to 32000 UNICODE characters.
- TD_SYSFNLIB
- The name of the database where the function is located.
- ARRAY_expr
- An expression that evaluates to an ARRAY data type.
- ARRAY_expr specifies the array to be converted to the JSON type.
- RETURNS data_type
- Specifies that data_type is the return type of the function.
- data_type can only be JSON.
- integer
- A positive integer value that specifies the maximum length in characters of the JSON type.
- If you do not specify a maximum length, the default maximum length for the character set is used. If specified, the length is subject to a minimum of two characters and cannot be greater than the maximum of 16776192 LATIN characters or 8388096 UNICODE characters.
- CHARACTER SET
- The character set for the return value of the function, which can be LATIN or UNICODE.
- If you do not specify a character set, the default character set for the user is used.
- RETURNS STYLE column_expr
- Specifies that the return type of the function is the same as the data type of the specified column. The data type of the column must be JSON.
- column_expr can be any valid table or view column reference.