Chapter 10 Generating a Database from a PDM


Creation parameters for tables & columns

These options control the generation of tables, columns, indexes, and keys.

Table options

These options control the generation of tables.

Parameter Result of selection
Create table Generates tables.
Check Generates check parameters and validation rules for tables. If selected you can choose between:

  • Inside Table - checks are generated during table creation
  • Outside - checks are generated with a separate SQL command, generally using an ALTER command after the creation of the table


The generation of checks outside the table is possible if the AddTableCheck entry exists in the Table category of the current DBMS.
Physical options Generates physical options for tables.
Begin script Inserts customized script before table creation.
End script Inserts customized script after table creation.
Comment Generates table comments.
Permission Generates the permission statement for a given user during table creation.
Drop table Deletes the existing table before creating the new table.

Column options

These options control the generation of columns.

Parameter Result of selection
User-defined type Generates user-defined data type for column
Default value Assigns default value to column at creation
Check Generates check parameters and validation rules for columns. If selected you can choose between:

  • Inside Table - checks are generated during table creation
  • Outside - checks are generated with a separate SQL command, generally using an ALTER command after the creation of the table


The generation of checks outside the table is possible if the AddTableCheck entry exists in the Table category of the current DBMS.
Comment Generates column comments
Physical options Generates physical options for column
Permission Generates the permission statement for the column during creation

Primary key options

These options control the generation of primary keys.

Parameter Result of the selection
Create primary key Generates primary keys. If selected you can choose between:

  • Inside Table - primary keys are generated during table creation
  • Outside - primary keys are generated with a separate SQL command, generally using an ALTER command after the creation of the table


The generation of primary keys outside the table is possible if the Create entry exists in the PKey category of the current DBMS.
Physical options Generates physical options for primary keys
Comment Generates key comments
Drop primary key Deletes an existing primary key, before creating a new primary key

Alternate key options

These options control the generation of alternate keys.

Parameter Result of the selection
Create alternate key Generates alternate keys. If selected you can choose between:

  • Inside Table - alternate keys are generated during table creation
  • Outside - alternate keys are generated with a separate SQL command, generally using an ALTER command after the creation of the table


The generation of alternate keys outside the table is possible if the Create entry exists in the Key category of the current DBMS.
Physical options Generates physical options for alternate keys
Comment Generates alternate key comments
Drop alternate key Deletes an existing alternate key, before creating a new alternate key

Foreign keys options

These options control the generation of foreign keys.

Parameter Result of selection
Create foreign key Generates foreign keys. If selected you can choose between:

  • Inside Table - foreign keys are generated during table creation
  • Outside - foreign keys are generated with a separate SQL command, generally using an ALTER command after the creation of the table


The generation of foreign keys outside the table is possible if the Create entry exists in the Reference category of the current DBMS.
Decl. Integrity Generates declarative referential integrity for references that have Declarative selected for referential integrity implementation in the reference property sheet. You can specify any or all of the following:

  • Update constraint restrict
  • Update constraint cascade
  • Update constraint set null
  • Update constraint set default
  • Delete constraint restrict
  • Delete constraint cascade
  • Delete constraint set null
  • Delete constraint set default
Comment Generates foreign key comments
Drop foreign key Deletes an existing foreign key , before creating a new foreign key

Index options

These options control the generation of indexes.

Parameter Result of selection
Create index Generates indexes. If selected you can choose between:

  • Inside Table - indexes are generated during table creation


create table customer (
	customer_id int not null, 
	customer_name varchar(50)
)
unique index CustomerIdx (customer_id);


  • Outside - indexes are generated with a separate SQL command, generally using an ALTER command after the creation of the table


create table customer (
	customer_id int not null, 
	customer_name varchar(50)
);

create unique index CustomerIdx on Customer(customer_id);


The generation of indexes outside the table is possible if the Create entry exists in the Index category of the current DBMS.
Physical options Generates physical options for indexes
Comment Generates index comments
Drop index Deletes an existing index before creating a new index
Index Filter You can specify from none to all of:

  • Primary key - Generates primary key indexes
  • Foreign key - Generates foreign key indexes
  • Alternate key - Generates alternate key indexes
  • Cluster - Generates cluster indexes
  • Others - Generates indexes for all key columns with a defined index

Trigger options

These options control the generation of triggers.

Parameter Result of selection
Create trigger Generates triggers
Drop trigger Deletes an existing trigger, before creating a new trigger
Comment Generates trigger comments
Trigger Filter You can specify the creation of triggers:

  • For insert
  • For update
  • For delete

 


Copyright (C) 2005. Sybase Inc. All rights reserved.