Understanding UltraLite.NET Development
Accessing and manipulating data with the Table API
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.
The following code inserts a new row.
t.InsertBegin(); t.SetInt( id, 3 ); t.SetString( lname, "Carlo" ); t.Insert();
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.
For nullable columns, NULL.
For numeric columns that disallow NULL, zero.
For character columns that disallow NULL, an empty string.
To explicitly set a value to NULL, use the setNull method.
For update operations, an insert is applied to the database in permanent storage when a commit is carried out. In AutoCommit mode, a commit is carried out as part of the insert method.
SQL Anywhere Studio 9.0.2
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.