Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - C and C++ Programming » Developing Applications Using the UltraLite C++ API » Accessing data with the Table API

Updating rows Next Page

Inserting rows


The steps to insert a row are very similar to those for updating rows, except that there is no need to locate a row in the table before carrying out the insert operation. The order of row insertion into the table has no significance since data is always inserted in the database according to the index.

Example

The following code fragment inserts a new row.

tbl.InsertBegin();
tbl.Set( UL_TEXT("id"), 3 );
tbl.Set( UL_TEXT("lname"), "Carlo" );
tbl.Insert();
tbl.Commit();

If you do not set a value for one of the columns, and that column has a default, the default value is used. If the column has no default, one of the following entries is used: