Equinox Online Help - Language Reference - A to Z
InsertRecord |
|
---|---|
Applies to | |
Syntax | InsertRecord [SwitchExpression] |
Action | [Statement] Inserts a new record into the database. |
Scope | Only usable in subtables. |
Notes | This statement inserts a new record into the current database. The optional argument, SwitchExpression, determines the field values of the new record. If SwitchExpression evaluates as True, then the new record is a duplicate of the last selected record. If the argument is False, or omitted, then the new record's fields are initially blank, unless they have been assigned in the method (before the InsertRecord statement). If an error occurs, an error number is stored in the system workarea SysError. The inserted record becomes the current record if the statement completes successfully. |
Category | Record editing |
See Also | BlankRecord, DeleteRecord, FieldChanged, IsField, ReplaceRecord |
Example | This method inserts a record into the grade table, for the current employee. Note that the field values are set before the InsertRecord statement is used (GradeNow is a field in the employee table, outside the block). subtable gradeBlankRecordend subtable | grade |