The JSON data type can be used similarly to other data types. For example, you can specify the JSON data type in these cases:
- In table definitions
- As parameters and return types for UDFs written in C, C++, or Java. This includes scalar and aggregate UDFs, table functions, and table operators.
- As IN, INOUT, and OUT parameters of stored procedures and external stored procedures written in C, C++, or Java.
- In local variable definitions in stored procedures
- As parameters and return types for UDMs written in C or C++.
- As an attribute of a structured user-defined type (UDT), but not as the base type of a distinct UDT
When used as an input or output parameter, you can specify the JSON type with the STORAGE FORMAT specification to pass binary JSON data to an external routine.