Advanced use of the commands

SQL-CREATE-VIEW can become more powerful using the advanced syntax. You can specify the columns in the SQL table, the data types, the precision and scale.

Syntax

SQL-CREATE-VIEW file_reference [’alternate_tablename’] column [column...]
[nested_table] [nested_table...] [USING [dict] file_reference][(options] 

   file_reference ::=
      file_name
      | file_name, data_level
      | account_name, file_name,
      | account_name, file_name, data_level
   column ::= attribute-defining-item{=data_type} 

   nested_table ::=
      {|[ [’alternate_tablename’] column [column...] [nested_table] }|] 

SQL-CREATE-TABLE file_reference [’alternate_tablename’] column [column...]
[nested_table] [nested_table...] [USING [dict] file_reference][(options] 

   file_reference ::=
      file_name
      | file_name, data_level
      | account_name, file_name,
      | account_name, file_name, data_level
   column ::= attribute-defining-item{=data_type} 

   nested_table ::=
      {|[ [’alternate_tablename’] column [column...] [nested_table] }|]
Note: A space appears between each column (not a comma).

Parameters

Parameter Description
alternate_ tablename The SQL table name. To override the default table name.
account_name The D3 account. Not required if the specified D3 file is in the current account.
file_name The D3 file name. If data_level is specified, this will be the dictionary name.
data_level Not required if the specified file (or dictionary) has the same name as the data level.
attribute-defining-item Name of the attribute-defining item (ADI) to be included in the table.
data_type See Manual data typing.
options a Include all base (a) attributes in the table. By default, only the attributes in the d-pointer macro and those specified on the command line are included.
b Backward compatibility for D3 7.1 and above. Inhibits the creation of pseudo primary keys on nested tables, making them compatible with older D3 servers.
c Use only the attributes specified on the command line. By default, the attributes in the d-pointer macro and those specified on the command line are included.
e Analyzes all file data (instead of the default 1000 items).
i Suppress intelligent mode. By default, the data in the file is analyzed to determine information not specified on the command line, such as data type and nesting structure.
o Overwrite existing table definitions
p Output to the printer. This option should be used with the z option to produce a report detailing the structure of the table created.
s Include all synonym (s) attributes in the table.
x Include all protected (x) attributes in the table.
z Verbose output. For each table created, this option displays any primary and nested keys created as well as a list of columns involved. For each column, the program displays the original attribute name, the SQL column name, the SQL data type, the column number, the column precision, and the correlative.