Records
- a primitive data type
- a DataItem part
- another Record
- a Dictionary
- an ArrayDictionary
- an array of any of the preceding types
A record is typically associated with an external data store like a record in a file or a row in a relational database table or view. EGL makes this association through the concept of the record stereotype and related properties (see Stereotypes). When the record ties to an external data store, the fields in the record must correspond to the data elements in the external data store. For SQL (relational database records) the fields correspond to columns in the database table.
Record CustomerRecord type SQLRecord
customerNumber INT; //key field
customerName CHAR(25);
customerAddr1 CHAR(25);
customerAddr2 CHAR(25);
customerAddr3 CHAR(25);
customerBalance MONEY;
endmyCustomer CustomerRecord;Now you have a space to put the data, but still no data. If the
Record part is like a blueprint for a bookcase, you now have a real
bookcase with nothing on the shelves. The myCustomer variable
has an empty shelf for each of the fields in the Record prototype.
You fill those shelves with the get statement.
myCustomer.customerBalance = 0;In addition to defining records that match the information in a relational database table, you can define records for serial, indexed, or relative files. You can also define records to hold information you need while your program is running, such as counters, totals, and so on.
- Structured records. Fields in these records include numbered levels. Use these records when the position of the fields in the record layout is critical; see Structured records.
- Variable-length records. Typically (but not necessarily) structured records, these records use fields in the record layout, modifiable at run time, to hold information about the total record length; see Variable-length records.