DBAdd

Use this procedure/function to add a new record to a database table.

Syntax

DBAdd (Table, PrefixVariable)

Parameter

Description

Table

Enter the name of an open table.

PrefixVariable

(Optional) Enter the name of a DAL variable to associate with the record fields of the table. The default is Table.

The system optionally returns one (1) on success and zero (0) on failure.

Unlike for the DBFirstRec and DBNextRec procedures, the PrefixVariable parameter and the associated fields should have already been defined. For some database handlers, these column names are case sensitive. Columns not required can be left blank.

The actual variable names appended with a prefix are taken from the DFD file. The DFD file is determined by your entry in the Table parameter or by using the column names found in the table if there is no DFD file associated with that table.

Possible causes for failure to add the record include:

Example

Here is an example:

Procedure

Result

Explanation

RECORD.Company="Oracle";

RECORD.Lob="Util";

RECORD.Rundate=DATE();

DBAdd( "APPIDX" , "RECORD" )

1 or 0

Assuming the table APPIDX has the columns Company, Lob, and Rundate, a new record will be added to the table whose values in those columns are Oracle, Util, and the current date, respectively.

See also