Previous Topic: Retrieving Information From CA IDMS/DB RecordsNext Topic: Retrieving data from two or more records


Retrieving data from a single record

Comparing a record to a table

Retrieving information from a CA IDMS/DB database record is comparable to retrieving rows from a table. The CA IDMS/DB record type (for example, the EMPLOYEE record) is like a table (for example, the EMP table). The EMPLOYEE record occurrences are like the rows of EMP table.

Signing on to a subschema

To access CA IDMS/DB database records, you have to first sign on to a subschema. A subschema is a view of the database. That is, it describes a subset of the database records that a CA IDMS/DB database contains.

To signon to a subschema, issue a SIGNON command:

signon ss=empss01

Coding the SELECT statement

To retrieve information from a single CA IDMS/DB database record, code the SELECT statement like this:

  1. Enter record field names instead of column names following the SELECT keyword: emp-last-name-0415
  2. Enter the record name instead of the table name following the FROM keyword: employee

Finding record names

If you do not know the record or the record field names that you need, issue these commands:

HELP RECORDS

Lists the records defined to the subschema you have accessed

HELP RECORD=record-name

Lists the fields associated with the named record

Example

List each office's code number, in ascending order, and city:

select office-code-0450, office-city-0450
  from office
  order by office-code-0450 ! display

OFFICE REPORT 01/27/99 OFFICE-CODE-0450 OFFICE-CITY-0450 ---------------- ---------------- 001 SPRINGFIELD 002 BOSTON 005 GLASSTER 008 WESTON 012 CAMBRIDGE END OF REPORT