Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Configuring tablespace and storage [Table of Contents] Generating a database

WarehouseArchitect - User's Guide

[-] Part 3 WarehouseArchitect Model
[-] Chapter 22: Database Creation and Modification
[-] Customizing scripts

Customizing scripts

You can customize scripts as follows:

Inserting begin and end scripts for database creation

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



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

%USER%

Author of the current model



Inserting begin and end scripts for table creation

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



These scripts can appear in database creation scripts and database modification scripts.

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



Editing a customized script

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



Editing a begin or end script for database creation

Editing a begin or end script for table creation

Formatting variables in customized scripts

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



You embed formatting options in variable syntax as follows:

%.format:variable%

For example:

%.L:TABLE%


Configuring tablespace and storage [Table of Contents] Generating a database