You can use the insert command to add rows to the database in two ways; with the values keyword or with a select statement:
The values keyword specifies values for some or all of the columns in a new row. A simplified version of the syntax for the insert command using the values keyword is:
insert table_name values (constant1, constant2, ...)
You can use a select statement in an insert statement to pull values from one or more tables (up to a limit of 50 tables, including the table into which you are inserting). A simplified version of the syntax for the insert command using a select statement is:
insert table_name select column_list from table_list where search_conditions
You cannot use a compute clause in a select statement that is inside an insert statement, because statements that include compute do not generate normal rows.
Copyright © 2005. Sybase Inc. All rights reserved. |