Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > Database API > Methods

Database API: Insert

Scroll Prev Next More

 

Inserts a record into a database.

Syntax

DB.Insert(table, values)

Arguments

table

the table into which the data is inserted.

values

an array with values that you wish to insert.

Return value

No return value.

Example

You can insert a record into any table.

 

// Insert a record into the Cars table
 
dynamic data = XVar.Array();
data["make"]="Toyota";
data["model"]="RAV4";
data["price"]=16000;
DB.Insert("cars", data);

See also:

Database API: Update()

Database API: Delete()

Database API: Select()

About Database API