![]() | ![]() |
Home |
|
|
WarehouseArchitect - User's Guide |
|
| Part 3 WarehouseArchitect Model |
|
| Chapter 22: Database Creation and Modification |
|
| Customizing scripts |
In a database creation script, you can insert the following scripts:
| Script
| Where it is inserted
|
|---|---|
| Begin script
| Before the command that creates the database
|
| End script
| After the last command in the database creation script
|
| Variable
| Description
|
|---|---|
| %DATABASE%
| Name of the current WAM
|
| %DATE%
| Date of script generation
|
| %DBMSNAME%
| Name of the DBMS for the target database
|
| %NAMESCRIPT%
| Filename of script file
|
| %PATHSCRIPT%
| Filename and path of script file
|
| %STARTCMD%
| Command that runs the script
|
| %USER%
| Author of the current model
|
The model property sheet appears.
The Model Script dialog box appears.
For each table, you have the option to insert the following scripts:
| Script
| Where it is inserted
|
|---|---|
| Begin script
| Immediately before the table creation command (after the table title)
|
| End script
| Immediately after the table creation command
|
You can use the following variables in these scripts:
| Variable
| Description
|
|---|---|
| %DATABASE%
| Name of the current WAM
|
| %DATE%
| Date of script generation
|
| %DBMSNAME%
| Name of the DBMS for the target database
|
| %NAMESCRIPT%
| Filename of script file
|
| %PATHSCRIPT%
| Filename and path of script file
|
| %STARTCMD%
| Command that runs the script
|
| %TABLE%
| Name or code of current table (based on display preferences)
|
| %TCODE%
| Code of the current table
|
| %TLABL%
| Label of the current table
|
| %TNAME%
| Name of the current table
|
| %USER%
| Author of the current model
|
The table property sheet appears.
The Table Script dialog box appears. The Begin Script radio button is selected.
| Switching between scripts By clicking the Begin Script and End Script radio buttons, you can move back and forth between scripts before validating them.
|
Using the script editor, you can insert the following categories of script language into a customized script:
| Category
| What it inserts in the script
|
|---|---|
| Variable
| Variable which is instanciated when the script is generated
|
| Table
| Table code
|
| Column
| Column code
|
| Join
| Parent table code, child table code, or join statement
|
| Function
| DBMS-specific function
|
| Operator
| Logical operator
|
The Model Script Definition dialog box appears.
For example, select Variable to display the list of variables.
For example, select %DATABASE%.
The selected item is inserted at the cursor position.
The table property sheet appears.
The Table Script Definition dialog box appears.
For example, select Variable to display the list of variables.
For example, select %DATABASE%.
The selected item is inserted at the cursor position.
Variables have a syntax that can force a format on their values, as follows:
When a variable does not specify formatting, its values have the same format as in the WAM.
| Format code
| Format of variable value in script
|
|---|---|
| .L
| Lower-case characters
|
| .T
| Removes blank spaces
|
| .U
| Upper-case characters
|
| .n
| Maximum length where n is the number of characters
|
| .nJ
| Justifies to fixed length where n is the number of characters
|
%.format:variable%
For example:
%.L:TABLE%
|
|