Purpose
Declares tables used by the embedded SQL statements within an application.
Invocation
Nonexecutable preprocessor declaration.
Embedded SQL only.
Syntax
DECLARE { table_name | view_name } TABLE ( column_spec [,...] )
- column_spec
-
column_name data_type [ null_attribute ]
- table_name
- The name of the table to be declared.
- view_name
- The name of the view to be declared.
- column_name
- The name of a column or columns being declared for the table.
- data_type
- The data type for column_name.
- null_attribute
- The nullability specification for column_name.
ANSI Compliance
DECLARE TABLE is a Teradata extension to the ANSI/ISO SQL:2011 standard.
Authorization
None.
Usage
DECLARE TABLE is useful for program documentation, but Preprocessor2 treats it only as a comment.
Preprocessor2 does not verify the syntax or correctness of the field definitions other than identifying, in order:
- The DECLARE keyword
- The presence of a table_name or view_name
- The TABLE keyword