
IMS data structures for SQL
SQL support allows you to issue standard SQL query to access IMS™ data instead of using DL/I calls. To use SQL calls in IMS application, you need to understand the difference between the hierarchical model for IMS databases and the standard relational database model since SQL calls are commonly used for relational databases. You also need to understand how IMS database elements are being mapped to relational database elements.
A database segment definition defines the fields for a set of segment instances similar to the way that a relational table defines columns for a set of rows in a table. In this regard, segments relate to tables, and fields in a segment relate to columns in a table. An occurrence of a segment in a database corresponds to a row in a table.
The following table summarizes the mapping between IMS database elements and relational database elements.
Hierarchical database elements in IMS | Equivalent relational database elements |
---|---|
Segment name | Table name |
Segment instance | Table row |
Segment field name | Column name |
Segment unique key | Table primary key |
Foreign key field | Table foreign key |
PCB | Schema |
Segment | Table |
Field | Column |
Record | Row |
Data set group or Area | Tablespace |
