In the -DR line tab, you specify which SQL objects make up the relational Database (Tables, Views, Index...). A -DR line definition section displays the object's type, external name, the code of the Segment representing the Block, the key type supported by the Segment and the generation code.
Objects are related to the Space which precedes them. An Alter Table must follow the Table it modifies. An Index must follow the Table to which it is related. A Primary key or Foreign key must follow the table holding the same Table code. It is not possible to create an Index associated with a View ; the generated CREATE INDEX command will be rejected when the catalog is updated. For RDMS and ALLBASE/SQL, the Primary Key is not generated by an I line ; it is included in the generation of the Table that precedes it (T line). The type of Index, Primary key or Foreign key must not be modified: these lines must be deleted, then created with another type. The Table code entered on Index, Primary key or Alter lines must not be modified.
Values | Descrition |
---|---|
P: Package | Tablespace (except for Interel RDBC, Interel RFM, Nonstop SQL, Sybase and SQL Server) |
T: Table | Table |
V: View | View |
I: Index | Index |
A: Alter table | Alter Table: Column updating |
K: Primary key | RDMS: Primary Key (Processed with the generation
of the table that precedes it.) DB2, Datacom/DB, SQL/DS, Oracle V6 and V7, DB2/2, DB2/6000, Sybase and SQL Server: Primary key (Processed with the generation through an ALTER TABLE command.) |
J: Foreign key | DB2, Datacom/DB, SQL/DS, Oracle V6 and V7, Sybase and SQL Server: Foreign key (Processed with the generation through an ALTER TABLE command.) |
C: Package | Package (Oracle V7 only) |
E: Function | Function (Oracle V7 only) |
Q: Procedure | Procedure (Oracle V7, Sybase, SQL Server) |
R: Trigger | Oracle V7, Sybase and SQL Server: Trigger |
Clicking the Segment code switch to the selected Segment's editor so as to view its composition for example.
Options | Description |
---|---|
U: UNIQUE | On a I-type line: This value is entered in order to generate the UNIQUE command. |
From 0: sub-schema 10 Data elements to 9: sub-schema 9 Data elements | On a V-type line: View of the sub-schema Data Element selection in the Segment. Value 0 corresponds to the sub-schema 10. |
All: Data elements | All Data Elements of the Segment are included in the View. |
R: restrict C: Cascade S: set null | On a J-type line: Restrict (default value for DB2-type Databases only) Cascade (DB2, SQL/DS, DB2/2, DB2/6000 and ORACLE V7 only) S: Set null (DB2, SQL/DS, DB2/2 and DB2/6000 only) |
BLANK: Standard packageBODY: BODY package | On a C-type line (ORACLE V7): Indicates the package type. BODY package standard package |
A: afterB: before | On a R-type line: Indicates where the trigger or the rule starts to operate: After Before |
Options | Description |
---|---|
C: Creation (CREATE) | 'Creation' is the default value when the line is created. It generates a CREATE statement. It is the only possible value for an Alter Table. |
M: Modification (ALTER) | 'Modification' i spossible on Table-type lines only, on all Database types, except SQL/400. It generates an ALTER statement. |
D: Cancellation (DROP) | Deletion' generates a DROP statement. For J (Foreign Key) and K (Primary Key) lines, a DROP PRIMARY KEY or DROP FOREIGN KEY command is generated in an ALTER TABLE command. |
: No generation | No generation will be executed via the GPRT procedure. |
The -GG Lines section is used to provide the physical information necessary in order to generate the block. It is associated with each description line. This section consists of a table in which you can modify the information contained in the Block Description lines before they are generated. Depending on the type of line, the system automatically generates virtual documentation lines associated with the description line. These lines can be modified or deleted.
For Relational database blocks, virtual lines are automatically generated for each SQL record type (Table, View, Index...). For example, you can modify the characteristics of a column or specify the source of a column in a View.
To override a column's pre-defined values, you identify the column by its Data Element code. After identifying the Column, you click Override and enter the desired values.
G CREATE TABLE (EXTERNAL NAME) IN DATABASE-NAME G ---> COLUMN INSERTION BEGINNING <--- G LIBFO G DO10LIBFO FLOAT G ---> COLUMN INSERTION END <--- G IN DATABASE-TABLESPACE
FFNNDELCOFFNNDELCO being the code entered in the SOURCE COLUMN field.
G CREATE VIEW (VIEW NAME) G ---> COLUMN INSERTION BEGINNING <--- G <LIBFO> G DO10LIBFO FLOAT G ---> COLUMN INSERTION END <--- G AS SELECT ALL G ---> SOURCE COLUMN INSERTION BEGINNING <--- G <FFNN-DELCO> G 'X' G ---> SOURCE COLUMN INSERTION END <--- G FROM (SOURCE TABLES NAME)You must manage the Source Table (after the FROM clause).
Using the virtual lines, you can specify the physical characteristics of the areas and sets (DMCL), including the information related to sort keys and insertion modes.
Options | Description |
---|---|
No order or add a column (ADD) | No DDL sort command is generated (default value) |
A: Ascending order or deletion of a column (DROP) | Tthe column is sorted in ascending order |
D: Descending order or deletion of a column (DROP) | The column is sorted in descending order. |
Options | Description |
---|---|
No order or add a column (ADD) | Default value : the Column is to be added. |
A: Ascending order or deletion of a column (DROP) | The Column is to be deleted. |
D: Descending order or deletion of a column (DROP) | The Column is to be deleted. |
M: Modification of a column (MODIFY) | The Column is to be modified. |