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

SQL Anywhere 17 » UltraLite - Database Management and Developer Guide » UltraLite SQL reference » UltraLite SQL statements

INSERT statement [UltraLite]

Inserts rows into a table.

table-name [ ( column-name, ... ) ]
{ VALUES ( expression, ... ) | select-statement }

The INSERT statement can be used to insert a single row, or to insert multiple rows from a query result set.

If columns are specified, values are inserted one for one into the specified columns. If the list of column names is not specified, values are inserted into the table columns in the order in which they appear in the table (the same order as retrieved with SELECT *). Rows are inserted into the table in an arbitrary order.

Character strings inserted into tables are always stored in the same case as they are entered, regardless of whether the database is case sensitive.


The following statement adds an Eastern Sales department to the database.

INTO Departments ( DepartmentID, DepartmentName )
VALUES ( 230, 'Eastern Sales' )

The following statement adds the values of a and b into mytable from othertable where the value of c in othertable is greater than 10.

INSERT INTO mytable( col1, col2 ) SELECT a, b FROM othertable WHERE c > 10