JSON External Files | CREATE FOREIGN TABLE SQL Statement | Teradata Database - JSON External Files - Teradata Database

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Teradata Database
Release Number
20.00
Published
June 2025
ft:locale
en-US
ft:lastEdition
2026-09-23
dita:mapPath
mbm1747160743883.ditamap
dita:ditavalPath
jlp1749501702948.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Each record in the JSON external data can span multiple lines—that is, the system can read data with embedded line breaks. However, each line break must precede or follow one of these characters:
  • Left brace ({)
  • Comma (,)
  • Double quotation mark (")
  • Right brace (})
  • Colon (:)

Line breaks cannot be within the quotation marks that surround the Name or Value of the Name/Value Pair.

External JSON files can contain individual records or a single JSON array that uses a comma (,) as the record delimiter. For single-array JSON files, the record can span across multiple lines. Optionally, the JSON array can be named.

The system can read the following JSON documents in external storage:

 {"field1": true,"field2": "somestring","field3": {"field4": 1}}
{
    "field1" : true,
    "field2":
         "somestring",
    "field3":
    {
        "field4":1
    }
}
[{
                "field1": "string1", "field2": "string2"
}, {
                "field1": "string3", "field2": "string4"
}]

The field names are case sensitive. So, a reference to Field1 will not match the "field1".

Spaces inside quotes for the field names are significant. So, if the record contained "field1 ", then a reference to payload.field1 does not match.

Here is an example of a named JSON array:

{ "Fruits":     [        \{ "fruit": "Apple", "size": "Large", "color": "Red" }
,   

       { "fruit": "Banana", "size": "Medium", "color": "Yellow" },

       { "fruit": "Orange", "size": "Medium", "color": "Orange" },

       { "fruit": "Guava", "size": "Small", "color": "Green" },

       { "fruit": "Grapes", "size": "VerySmall", "color": "Black" }  

   ]

}

External JSON files can be compressed in GZIP format. Other forms of file compression are not supported.