Data 360 SQL and Tableau Hyper API
Boolean Type
String Types
Numeric Types
Date/Time Types
Binary Type
Array Type
JSON Type
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API
The json type stores a JSON (JavaScript Object Notation) value, such as an object, array, string, number, boolean, or null. Use it to model semi-structured data in a single SQL value, for example nested attributes that don’t map cleanly to columns.
You can create json values in these ways.
[json](../scalar-func/json-func/json-constructor.md) constructor or a cast (see Parsing and Validation below).[json_array](../scalar-func/json-func/json-array.md), [json_object](../scalar-func/json-func/json-object.md), or [json_scalar](../scalar-func/json-func/json-scalar.md).For a comprehensive overview of supported operations, see JSON Functions.
You can convert a string to json with the json constructor, or with a cast using CAST, TRY_CAST, or :: (see Type Conversions for the general cast syntax). All three forms validate that the string is a well-formed JSON document.
1SELECT '{"a":1}'::json;Returns {"a":1}.
1SELECT CAST('{]' AS json);Raises an error because the input isn’t valid JSON.
1SELECT TRY_CAST('{]' AS json);Returns NULL instead of raising an error.
Validation follows the JSON standard.
1e2, 1E+2, and 1e-2. Malformed numbers such as 2.e+3, 0.e1, or [1.] are rejected.0x7F) doesn’t require escaping.json value is embedded into another JSON value by [json_array](../scalar-func/json-func/json-array.md) or [json_object](../scalar-func/json-func/json-object.md), it’s copied in directly rather than escaped as a string.[json](../scalar-func/json-func/json-constructor.md) - Parse a string into a JSON value.