CREATE FOREIGN TABLE Syntax | Teradata Vantage - 17.00 - CREATE FOREIGN TABLE Syntax - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Release Date
September 2020
Content Type
Programming Reference
Publication ID
B035-1144-170K
Language
English (United States)

For external data formatted as CSV or JSON:

CREATE [MULTISET] FOREIGN TABLE table_specification 
[ table_options ]
[ , external_security_clause ]
[ ( location_column, payload_column ) ]
USING (
  LOCATION ( 'external_file_path' ) 
  [ PATHPATTERN ( 'value' ) ]
  [ MANIFEST ( { 'TRUE' | 'FALSE' } ) ] 	
  [ ROWFORMAT ( 'encoding_format' ) ]
  [ STOREDAS ( 'TEXTFILE' ) ]
  )
[ [,] NO PRIMARY INDEX ] 
[ [,] PARTITION BY COLUMN ] [;]

For external data formatted as Parquet:

CREATE [MULTISET] FOREIGN TABLE table_specification 
[ table_options ]
[ , external_security_clause ]
[ ( location_column, data_column_definition ) ]
USING (
  LOCATION ( 'extemal_file_path' ) 
  [ PATHPATTERN ( 'value' ) ]
  [ MANIFEST ( { 'TRUE' | 'FALSE' } ) ] 	
  STOREDAS ( 'PARQUET' )
  )
[ [,] NO PRIMARY INDEX ] 
[ [,] PARTITION BY COLUMN ] [;]
table_specification
[database_name. | user_name.] table_name
external_security_clause
EXTERNAL SECURITY {
  DEFINER TRUSTED [ authorization_name ] |  
  [ INVOKER ] TRUSTED  authorization_name
}