Primary Key Use

Primary keys in database tables indicate which fields are used to uniquely identify each record.  For example, a Customer table generally has a CustomerID primary key field that contains a unique customer ID value for each individual customer.  In order to generate code that can update or delete an individual record, Iron Speed Designer must know which field(s) to use as the primary key for selecting and accessing individual records.

Frequently, a table will use several fields together to form a primary key.  These are called composite primary keys.  For example, a Customer table may use the combination of a phone number field and last name field to uniquely identify a customer record.

Iron Speed Designer determines composite key relationships by querying the system information in the connected database(s).  If multiple rows are returned for a given table, it means that the table has a composite primary key, i.e. a primary key consisting of multiple fields.

Iron Speed Designer also supports database tables without primary keys.  In general, you can perform any operation on a table lacking a primary key with the exception that individual records cannot be selected for update or deletion.

An example web page generated by Iron Speed Designer.  The application uses primary key relationships to retrieve the appropriate Order table record for editing.  The application uses foreign key relationships to retrieve the associated Customer and Order Detail table records for editing.

See Also

Transaction Management