I Table and Column Prefixes

You can define table and column prefixes for instances when in some source applications, the table and column names can begin with special characters that Data Augmentation Scripts doesn't support for IMPORT.

By defining the table and column prefix, you have the option of providing prefixes for tables and column names. You can then use the prefixed object names in subsequent code.

Note:

  • You must start prefixes with an alphabet. Other characters in the prefix don't have to be alphabets.
  • Keywords not allowed as prefix.
  • Precede TABLEPREFIX with COLPREFIX when you provide both.
  • Use the prefix names when you reference prefixed columns and tables in datasets.
  • Table-level prefixes override application-level prefixes when you provide both prefixes.
  • Alias takes precedence over application level prefixes when you define both application-level table prefix and import as Alias.

Application level prefix for tables and columns

To ensure that all the tables and columns in the application have the same prefix, you can specify prefixes at the application level.

Syntax
application_source_definition ::= APPLICATION SOURCE (COLPREFIX'['<string>']' | TABLEPREFIX'['<string>']') ]
Example
APPLICATION SOURCE TABLEPREFIX["CPQ"] COLPREFIX["CPQ"]

IMPORT SOURCE _TRANSACTION_HEADER //Interpret as IMPORT SOURCE _TRANSACTION_HEADER AS CPQ_TRANSACTION_HEADER

// When referencing prefixed tables in dataset, ensure CPQ prefix is used by the developer
DEFINE DATASET DW_THEADER_F FROM CPQ_TRANSACTION_HEADER END 

DEFINE DATASET DW_THEADER_F1
 ROWSOURCE CPQ_TRANSACTION_HEADER;
 THIS = TRANSACTION_HEADER EXCLUDE [CPQ_COL1]; // When referencing prefixed columns in dataset, ensure CPQ prefix is used by the developer
 THIS = TRANSACTION_HEADER[CPQ_COL2];
 THIS[SALES] = TRANSACTION_HEADER[CPQ_COL3];
END

Table level prefixes for tables and columns

You can specify prefixes at the table and column levels.

Syntax

Check COLPREFIX and TABLEPREFIX in the source_definition syntax.

Example
IMPORT SOURCE _TRANSACTION_HEADER COLPREFIX["AA"] TABLEPREFIX["AA"]
DEFINE DATASET DW_THEADER_F
 ROWSOURCE AA_TRANSACTION_HEADER;
 THIS = AA_TRANSACTION_HEADER[AA_COL1,AA_COL2,AA_COL3];
 PRIMARYKEY[AA_COL1];
END