Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Conversion rules

&pagelevel(3)&pagelevel

The CODASYL definitions are converted to relational schema information according to the following rules.

No.

CODASYL subschema

Relational schema description

1

Record type

Base table identified with TABLE ....
Name of the base table: record-type-name

2

Record type that is owner record type in at least one set

Primary key:
record-type-name_ of data type INTEGER
Additional information:
PRIMARY KEY SYSTEMDEFINED
Null-value condition: NOT NULL

3

Item of a record type

Field of the base table of the corresponding data type with null-value condition: NOT NULL
Default value:
0 for numeric fields
''BLANK'' for alphanumeric fields

4

Group item, repeating group

Data type STRUCTURE

5

Repeating factor

(repeating factor)

6

Item of type DATABASE-KEY

Field of the base table with the same name
Data type: INTEGER
Default value: 0

7

Item of type DATABASE-KEY-LONG

Field of the base table with the same name
Data type: CHARACTER ; length 8
Additional information:
ATTRIBUTE item-name IS DEFINED AS DATABASE-KEY-LONG; default value: X'00..00'

8

One or more SYSTEM sets not defined MANDATORY AUTOMATIC

A base table with the name SYSTEM and primary key SYSTEM_ , of data type INTEGER

9

Set relationship

Foreign key in the base table that corresponds to the member record type
Field name: set-name_
Data type: INTEGER
Reference condition:
REFERENCES owner-record-type-name

10

Set: MANDATORY AUTOMATIC

Foreign key with null-value condition:
NOT NULL

11

Set: MANDATORY MANUAL

Foreign key with null-value condition:
NOT NULL ON UPDATE
Default value: NULL

12

Set: OPTIONAL AUTOMATIC

Foreign key with null-value condition:
NOT NULL ON INSERT

13

Set: OPTIONAL MANUAL

Foreign key without null-value condition
Default value: NULL

14

Key consisting of one or more items. e.g. for compound keys:

Additional information:

left-hand column:
INDEX ([set-name_,]group-name)

right-hand column:
INDEX ([set-name_,]field-1,...,field-n)

15

Unique key at record type level consisting of one item

Additional information UNIQUE for the key field

16

Unique key at set level consisting of one item for a SYSTEM set defined with MANDATORY AUTOMATIC

Additional information UNIQUE for the key field

17

Unique key at record type level consisting of multiple items

Additional information UNIQUE for the corresponding base table:
UNIQUE (item-1,...,item-n)

18

Unique key at set level consisting of multiple items for a SYSTEM set defined with MANDATORY AUTOMATIC

Additional information UNIQUE for the base table corresponding to the member record type:
UNIQUE (item-1,...,item-n)

19

Unique key at set level consisting of one or more items for a set defined with MANDATORY AUTOMATIC, or for a SYSTEM set not defined with MANDATORY AUTOMATIC

Additional information UNIQUE for the base table corresponding to the member record type:
UNIQUE (set-name_,item-1,...,item-n)
where set-name_ is the associated foreign key attribute

Table 15: Conversion rules for BPSQLSIA                                                                                                                                

The name of the CODASYL subschema becomes the name of the relational schema.Hyphens in names in the CODASYL schema are replaced by underscores in the derived names in the relational schema information.
Condition names (level number 88) are not output in the relational schema information.

Examples of the individual rules can be found on "Example".

The meanings of the relational terms and concepts are explained with examples in the “SQL for UDS/SQL“ manual.