Creates a new database record, displays the initial values for the fields in the record, prompts for values of those fields, and assigns those values to the record.
The INSERT statement is a combination of the following statements:
INSERT record [ EXCEPT field ... ] [ USING { ROWID ( nrow ) | RECID ( nrec ) } ] [ frame-phrase ] [ NO-ERROR ] |
The name of the record you want to add to a database file. The AVM creates one record buffer for every file you use in a procedure. This buffer is used to hold a single record from the file associated with the buffer. Use the DEFINE BUFFER statement to create additional buffers, if necessary. The CREATE part of the INSERT statement creates an empty record buffer for the file in which you are inserting a record.
To insert a record in a table defined for multiple databases, you must qualify the record's table name with the database name. See the record definition in the Record phrase reference entry for more information.
In this procedure the user adds a new Order record. After the user adds a new Order record, the procedure creates OrderLines for that record. The procedure uses the CREATE statement to create OrderLines rather than the INSERT statement. When you use the INSERT statement, the PROMPT-FOR and ASSIGN parts of the INSERT let you put data into all the fields of the record being inserted. In the case of OrderLines, this procedure only lets you add information into a few of the OrderLine fields. Use CREATE together with UPDATE to single out the OrderLine fields.
r-insrt.p
When inserting fields, you must use filenames that are different from field names to avoid ambiguous references. See the Record phrase reference entry for more information.