Progress
Language Reference
CREATE Statement
Creates a record in a file, sets all the fields in the record to their default initial values, and moves a copy of the record to the record buffer.
DATA MOVEMENT
![]()
SYNTAX
record
The name of the record or record buffer you are creating.
To create a record in a file defined for multiple databases, you might have to qualify the record’s filename with the database name. See the Record Phrase reference entry for more information.
USING { ROWID ( nrow ) | RECID ( nrec ) }
For backward compatibility only.
NO-ERROR
Specifies that any errors that occur in the attempt to create the record are suppressed. After the CREATE statement completes, you can check the ERROR-STATUS system handle for information on any errors that might have occurred.
EXAMPLEThe following example creates a record in the order file for each pass through the loop and then updates the record. It also creates an order-line record.
This procedure adds orders and order-lines to the database. Because the user supplies an order number when updating the order record, that order number is assigned (=) to the order-num field of the order-line record when the order-line record is created.
NOTES
- When you run procedures that create large numbers of records (for example, during initial data loading), the process runs much faster if you use the No Crash Protection (-i) parameter. See the Progress Startup Command and Parameter Reference for more information on startup parameters. Back up your database before you use this parameter.
- After you create a new record with CREATE, Progress waits to write the record to the database until after the next statement generates an index entry for the record.
- The CREATE statement causes any related database CREATE triggers to execute. All CREATE triggers execute after the record is actually created. If a CREATE trigger fails (or executes a RETURN statement with the ERROR option), the record creation is undone. See the Progress Programming Handbook for more information on database triggers.
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |