15.00 - JSON_DECOMPRESS - Teradata Database

Teradata Database SQL Functions, Operators, Expressions, and Predicates

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1145-015K
Language
English (United States)

JSON_DECOMPRESS

Purpose  

Uncompresses the JSON data previously compressed using the JSON_COMPRESS function.

Syntax  

where:

 

Syntax element…

Specifies…

TD_SYSFNLIB

the name of the database where the function is located.

compressed_JSON_data

JSON data that was compressed using the JSON_COMPRESS function.

Note: This function takes no arguments when used as part of the COMPRESS USING or DECOMPRESS USING phrases. For more information about the COMPRESS/DECOMPRESS phrase, see SQL Data Types and Literals.

ANSI Compliance

This is a Teradata extension to the ANSI SQL:2011 standard.

Argument Type and Rules

This function only uncompresses JSON data types. It cannot be used to uncompress any other data type. Users cannot create their own UDFs for compressing and uncompressing JSON data.

Result Type

The return data type of the function is JSON.

Example  

Although you can call the function directly, JSON_DECOMPRESS is often used with the DECOMPRESS USING phrase to uncompress table columns. In the following table, the JSON data in the json_col column is uncompressed using the JSON_DECOMPRESS function.

CREATE TABLE temp (
   id        INTEGER,
   json_col  JSON(1000) 
             CHARACTER SET LATIN 
             COMPRESS USING JSON_COMPRESS
             DECOMPRESS USING JSON_DECOMPRESS);

For more information about the DECOMPRESS USING phrase, see SQL Data Types and Literals.