## Syntax Rules Arranged Semantically

The following overview lists the syntax rules required for the Loader commands, sorted semantically.

The syntax rules can also be displayed alphabetically: Syntax Rules in Alphabetical Order. In that section, you can also find a description of the syntax notation used.

<set_command> ::= SET
| SET CSV '/<separator>/<delimiter>/'
| SET <null_spec>
| SET <bool_spec>
| SET <number_spec>
| SET FORMAT <standard_date_mask>
| SET DATE <standard_date_mask>
| SET TIME <standard_time_mask>
| SET TIMESTAMP <standard_timestamp_mask>
| SET CODETYPE <standard_code_spec>
| SET <code_page_spec>
| SET <isolation_level_spec>
| SET TRANSACTION SIZE <unsigned_integer>
| SET CURRENT_SCHEMA = <schema_name>
| SET MAXERRORCOUNT <unsigned_integer>
| SET CONFIGURATION <exclude_include>
| SET BACKUPTOOL <backup_tool_spec>

<separator_spec> ::= SEPARATOR '<separator>'
<separator> ::= <character>
<delimiter_spec> ::= DELIMITER '<delimiter>'
<delimiter> ::= <character>
<null_spec> ::= NULL '<literal>'
<bool_spec> ::= BOOLEAN '<true_value>/<false_value>'
<true_value> ::= <! SET command !>
<false_value> ::= <! SET command !>

<date_spec> ::= DATE <standard_date_mask> | DATE '<free_mask_date>'
<time_spec> ::= TIME <standard_time_mask> | TIME '<free_mask_time>'
<timestamp_spec> ::= TIMESTAMP <standard_timestamp_mask> | TIMESTAMP '<free_mask_timestamp>'
<standard_date_mask> ::= EUR | INTERNAL | ISO | JIS | USA
<standard_time_mask> ::= EUR | INTERNAL | ISO | JIS | USA
<standard_timestamp_mask> ::= EUR | INTERNAL | ISO | JIS | USA
<free_mask_date> ::= <! Date specifications !>
<free_mask_time> ::= <! Time specifications !>
<free_mask_timestamp> ::= <! Time stamp specifications !>

<number_spec> ::= DECIMAL '/[<digit_grouping_symbol>]/<decimal_symbol>/'
<digit_grouping_symbol> ::= <! SET command !>
<decimal_symbol> ::= <! SET command !>

<int_spec> ::= INTEGER HILO | INTEGER LOHI

<lob_code_spec> ::= <code_spec> | BINARY
<code_spec> ::= <standard_code_spec> | CODESET <literal>
<standard_code_spec> ::= ASCII | UCS2 | UTF8
<code_page_spec> ::= CODEPAGE [<literal>]

<exclude_include> ::= EXCLUDE | INCLUDE
<backup_tool_spec> ::= BACKINT | NETWORKER | TSM

<sql_mode_command> ::= SQLMODE <sql_mode>
<sql_mode> ::= INTERNAL | ANSI | DB2 | ORACLE
<isolation_level_spec> ::= ISOLATION LEVEL <unsigned_integer>
<autocommit_command> ::= AUTOCOMMIT ON | AUTOCOMMIT OFF

<remark_command> ::= REMARK "<literal>"

<use_database_command> ::= USE DB <database_spec>
<use_user_command> ::= USE USER <user_spec> [SCHEMA <schema_name>]
[DB <database_spec>] [<isolation_level_spec>]
<use_schema_command> ::= USE SCHEMA <schema_name>
<use_schema_map_command> ::= USE SCHEMAMAP <schema_map_name>
<database_spec> ::= <database_name> [ON <database_computer>
[ENCRYPTION <protocol_name>]]
<user_spec> ::= <database_user> <password>
<database_computer> ::= <! USE DB command !>
<database_name> ::= <! USE DB command !>
<protocol_name> ::= <! USE DB command !>
<database_user> ::= <! SQL Reference Manual !>
<password> ::= <! SQL Reference Manual !>

<schema_name> ::= <identifier>
<schema_map_name> ::= <identifier>
<table_name> ::= [<schema_name>.]<identifier>

<column_spec> ::= <column_name> | <column_id>
<column_name> ::= <identifier>
<column_id> ::= <unsigned_integer>
<column_function> ::= TRUE | FALSE | DATE | TIME | TIMESTAMP | STAMP
| USER | USERGROUP | <sequence_number>
<sequence_number> ::= SEQNO | SEQNO <integer> | SEQNO <integer> <integer>

<field_spec> ::= <unsigned_integer> | <unsigned_integer> - <unsigned_integer>
<field_type> ::= /* empty */ | CHAR | DECIMAL [<unsigned_integer>]
| INTEGER | REAL | ZONED [<unsigned_integer>]
<field_function> ::= <field_type> [HEX] | <numerical_functions>
| <field_type> [HEX] <numerical_functions>
<numerical_functions> ::= <scale_spec> | <round_or_trunc_spec>
| <scale_spec> <round_or_trunc_spec>
<round_or_trunc_spec> ::= ROUND <unsigned_integer> | TRUNC <unsigned_integer>
<scale_spec> ::= SCALE <unsigned_integer>

<map_column_field> ::= <column_name> <field_spec> <field_function> <null_assign>
<map_field_column> ::= <column_name> <field_spec> <field_function>
<map_schema_spec> ::= MAP SCHEMA [<schema_map_name> | <schema_to_schema>,...]
<schema_to_schema> ::= <schema_name> TO <schema_name>

<null_assign> ::= [IF] NULL SET '<literal>'
<null_condition> ::= NULL [IF] <condition> | DEFAULT NULL
<if_condition> ::= IF <condition>
<condition> ::= (<condition>) | <condition> AND <condition>
| <condition> OR <condition> | NOT <condition>
| <simple_condition>
<simple_condition> ::= POS <field_spec> <field_type> [HEX] <compare_operator> '<literal>'
<compare_operator> ::= < | > | = | <= | >= | !=

<export_command> ::= <export_db_command>
| <export_user_command>
| <export_schema_command>
| <export_table_command>
| <export_columns_command>

<import_command> ::= <import_db_command>
| <import_user_command>
| <import_schema_command>
| <import_table_command>
| <import_columns_command>

<export_db_command> ::= EXPORT DB
[<configuration_spec>]
<catalog_data_outstream_part_spec>
[<package_spec>]
[<restart_spec>]

<import_db_command> ::= IMPORT DB
[<duplicates_clause>]
[<configuration_spec>]
<catalog_data_instream_part_spec>
[<package_spec>]
[<restart_spec>]

<export_user_command> ::= EXPORT USER
[<configuration_spec>]
<catalog_data_outstream_part_spec>
[<package_spec>]
[<restart_spec>]

<import_user_command> ::= IMPORT USER
[<duplicates_clause>]
[<configuration_spec>]
<catalog_data_instream_part_spec>
[<package_spec>]
[<restart_spec>]

<export_schema_command> ::= EXPORT SCHEMA <schema_name>
[<configuration_spec>]
<catalog_data_outstream_part_spec>
[<package_spec>]
[<restart_spec>]

<import_schema_command> ::= IMPORT SCHEMA <schema_name>
[<duplicates_clause>]
[<map_schema_spec>]
[<configuration_spec>]
<catalog_data_instream_part_spec>
[<package_spec>]
[<restart_spec>]

<export_table_command> ::= EXPORT TABLE <table_name>
[<restore_spec>]
[<order_clause>]
<catalog_data_outstream_table_spec>
[<package_spec>]

<import_table_command> ::= IMPORT TABLE <table_name>
[<if_condition>]
[<duplicates_clause>]
<catalog_data_instream_table_spec>
[<package_spec>]

<export_columns_command> ::= EXPORT COLUMNS<select_expression>
[MAP COLUMNS <export_column_spec> ...]
<data_outstream_column_spec>
<select_expression> ::= <! <select_statement>
without specifying the keyword SELECT> !>
<export_column_spec> ::= <map_column_field> | <field_assignment>
<field_assignment> ::= '<literal>' <field_spec>

<import_columns_command> ::= IMPORT COLUMNS TABLE <table_name>
[<if_condition>]
[<duplicates_clause>]
<import_column_spec> ...
<data_instream_column_spec>
<import_column_spec> ::= <map_field_column> [<null_condition>] | <column_assignment>
<column_assignment> ::= <column_name> '<literal>' | <column_name> <column_function>

<update_columns_command> ::= UPDATE COLUMNS TABLE <table_name>
[<if_condition>]
<update_column_spec> ... <set_column_spec> ...
<data_instream_column_spec>
<update_column_spec> ::= <map_field_column> | <column_assignment>
<set_column_spec> ::= SET <load_column_spec>

<order_clause> ::= ORDER BY <column_name>,...
<duplicates_clause> ::= REJECT DUPLICATES | IGNORE DUPLICATES
| UPDATE DUPLICATES
<start_spec> ::= START <unsigned_integer> [MAXROWS]
| START <unsigned_integer> [MAXRECORDS]
| START <unsigned_integer> <unsigned_integer>
<restart_spec> ::= RESTART <package_guid>
<package_guid> ::= <unsigned_integer>

<catalog_data_outstream_part_spec> ::= <catalog_outstream_spec>
| <data_outstream_part_spec>
| <catalog_outstream_spec> <data_outstream_part_spec>
<catalog_data_instream_part_spec> ::= <catalog_instream_spec>
| <data_instream_part_spec>
| <catalog_instream_spec> <data_instream_part_spec>
<catalog_data_outstream_table_spec> ::= <catalog_outstream_spec>
| <data_outstream_table_spec>
| <catalog_outstream_spec> <data_outstream_table_spec>
<catalog_data_instream_table_spec> ::= <catalog_instream_spec>
| <data_instream_table_spec>
| <catalog_instream_spec> <data_instream_table_spec>

<data_outstream_table_spec> ::= <data_outstream_part_spec>
| <data_outstream_column_spec>
<data_instream_table_spec> ::= <data_instream_part_spec>
| <data_instream_columns_spec>

<configuration_spec> ::= CONFIGURATION <instream_csv_spec>
<catalog_outstream_spec> ::= CATALOG <outstream_ddl_spec>
<catalog_instream_spec> ::= CATALOG <instream_ddl_spec>
<data_outstream_part_spec> ::= DATA <outstream_tableformat_spec>
<data_instream_part_spec> ::= DATA <instream_tableformat_spec>
<data_instream_columns_spec> ::= DATA <instream_columnformat_spec>
[<import_column_spec> ... <import_lobcolumn_spec> ...]
[<usage_spec>]
<data_outstream_column_spec> ::= DATA <outstream_columnformat_spec>
[<export_lobcolumn_spec> ...]

<data_instream_column_spec> ::= DATA <instream_columnformat_spec>
[<import_lobcolumn_spec> ...]
<export_lobcolumn_spec> ::= LOB <outstream_lob_spec>
<import_lobcolumn_spec> ::= LOB <instream_lob_spec>
<package_spec> ::= PACKAGE <outstream_csv_spec>

<outstream_ddl_spec> ::= OUTSTREAM [<mediumtype_spec>] '<stream_name>' [DDL]
<instream_ddl_spec> ::= INSTREAM [<mediumtype_spec>] '<stream_name>' [DDL]

<outstream_tableformat_spec> ::= OUTSTREAM [<mediumtype_spec>] '<stream_name>'
[<table_dataformat_spec>]
<instream_tableformat_spec> ::= INSTREAM [<mediumtype_spec>] '<stream_name>'
[<table_dataformat_spec>]

<outstream_columnformat_spec> ::= OUTSTREAM [<mediumtype_spec>] '<stream_name>'
[<column_dataformat_spec>] [<start_spec>]
<instream_columnformat_spec> ::= INSTREAM [<mediumtype_spec>] '<stream_name>'
[<column_dataformat_spec>] [<start_spec>]

<outstream_csv_spec> ::= OUTSTREAM [<mediumtype_spec>] '<stream_name>'
[CSV [<csv_format_spec> ...]] [<start_spec>]
<instream_csv_spec> ::= INSTREAM [<mediumtype_spec>] '<stream_name>'
[CSV [<csv_format_spec> ...]] [<start_spec>]

<outstream_fwv_spec> ::= OUTSTREAM [<mediumtype_spec>] '<stream_name>'
FWV [<fwv_format_spec> ...] [<start_spec>]
<instream_fwv_spec> ::= INSTREAM [<mediumtype_spec>] '<stream_name>'
FWV [<fwv_format_spec> ...] [<start_spec>]

<outstream_lob_spec> ::= OUTSTREAM [FILE] <column_spec> '<stream_name>'
[<lob_code_spec>]
<instream_lob_spec> ::= INSTREAM [FILE] <column_spec> <lob_code_spec>
| INSTREAM [FILE] <column_spec> '<stream_name>'
[<lob_code_spec>]

<outstream_records_spec> ::= OUTSTREAM [<mediumtype_spec>] '<stream_name>'
RECORDS [<records_format_spec>]
<instream_records_spec> ::= INSTREAM [<mediumtype_spec>] '<stream_name>'
RECORDS [<records_format_spec>]

<outstream_pages_spec> ::= OUTSTREAM [<mediumtype_spec>] '<stream_name>'
[PAGES]
<instream_pages_spec> ::= INSTREAM [<mediumtype_spec>] '<stream_name>'
[PAGES]

<mediumtype_spec> ::= FILE | PIPE | TAPE [<ebid_spec>]
<ebid_spec> ::= EBID '<literal>'

<stream_name> ::= <! Data stream !>

<usage_spec> ::= RECORDS USAGE
| PAGE WITH <unsigned_integer> % USAGE
| PAGE WITH <unsigned_integer> RECORDS USAGE

<table_dataformat_spec> ::= PAGES | RECORDS <records_format_spec>
<column_dataformat_spec> ::= CSV <csv_format_spec> ...
| FWV [BINARY] <fwv_format_spec> ...
| FWV BINARY <fwv_format_spec> ... <noheader_spec>

<csv_format_spec> ::= <separator_spec> | <delimiter_spec>
| <null_spec> | <field_format_spec>
<fwv_format_spec> ::= <null_spec> | <int_spec> | <field_format_spec>
<records_format_spec> ::= <field_format_spec> ...
<field_format_spec> ::= <bool_spec> | <code_spec> | <date_spec>
| <number_spec> | <time_spec> | <timestamp_spec>

<noheader_spec> ::= NOHEADER <unsigned_integer>

<character> ::= <! SQL Reference Manual !>
<identifier> ::= <! SQL Reference Manual !>
<literal> ::= <! SQL Reference Manual !>
<unsigned_integer> ::= <! SQL Reference Manual !>