
Table 16-1 specifies the compatible scalar data types - any other type combinations are incompatible entails a mismatch error. If there is any type incompatibility then a mismatch error occurs. If all names match then the corresponding data types are checked for compatibility.

If the names do not match (case insensitively, by default), then a mismatch error occurs. A field value that is an array or an object is handled recursively, so that ultimately it is the names of JSON fields with scalar values that are compared with the names of scalar SQL object attributes. The field names of the targeted JSON object are compared with the SQL names of the object attributes. If they do not then a mismatch error occurs. The JSON fields must correspond, one-to-one, with the object-type attributes. The fields of a targeted JSON object provide the attribute values of a returned object-type instance. A JSON array element that is an object (see next) or an array is handled recursively. The JSON array elements must correspond, one-to-one, with the collection-type elements. The elements of a targeted JSON array provide the elements of a returned collection-type instance. JSON object or array in the path expression and specifying the object or collection type,

You can use SQL/JSON function json_value to instantiateĪn instance of a user-defined SQL object type or collection type. SQL/JSON function json_value can be viewed as a special case of function json_table. You do this by targeting a JSON object or array in the path expression and specifying the object or collection type, respectively, in the RETURNING clause. You can use SQL/JSON function json_value to instantiate an instance of a user-defined SQL object type or collection type.

Ultimately it is the names of JSON fields with scalar values

Is an array (see previous) or an object is handled recursively, Value in the returned object-type instance (see above). A scalar field value produces a scalar SQL The field names of the targeted JSON object are compared with the SQL names Object provide the attribute values of the returned object-type instance. The return type, then json_value returns an instance of Object, and you specify a user-defined SQL object type as Object (see next) or an array is handled recursively. Returned collection instance (see previous). A scalar JSON array element produces a scalar SQL value in the Targeted JSON array provide the elements of the returned collection-type Nested table) as the return type, then json_value returns By default it isĪrray, and you specify a SQL collection type (varray or Specify the SQL data type for the returned scalar value. Scalar JSON value then it returns a scalar SQL value.
