EasyManua.ls Logo

Sybase Adaptive Server Anywhere - INSERT Statement

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
INSERT statement
554
INSERT statement
Use this statement to insert a single row (syntax 1) or a selection of rows
from elsewhere in the database (syntax 2) into a table.
INSERT [ INTO ] [
owner
.]
table-name
[(
column-name
, … )]
VALUES (
expression
| DEFAULT, … )
INSERT [ INTO ] [
owner
.]
table-name
[(
column-name
, … )]
select-statement
Must have INSERT permission on the table.
None.
"INPUT statement" on page 550
"UPDATE statement" on page 637
"DELETE statement" on page 496
"PUT statement" on page 582
The INSERT statement is used to add new rows to a database table.
Syntax 1 Insert a single row, with the specified expression values. The
keyword DEFAULT can be used to cause the default value for the column to
be inserted. If the optional list of column names is given, the values are
inserted one for one into the specified columns. If the list of column names is
not specified, the values are inserted into the table columns in the order they
were created (the same order as retrieved with SELECT *). The row is
inserted into the table at an arbitrary position. (In relational databases, tables
are not ordered.)
Syntax 2 Carry out mass insertion into a table with the results of a fully
general SELECT statement. Insertions are done in an arbitrary order unless
the SELECT statement contains an ORDER BY clause. The columns from
the select list are matched ordinally with the columns specified in the column
list, or sequentially in the order in which the columns were created.
Inserts can be done into views, if the query specification defining the view is
updatable and has only one table in the FROM clause.
An inherently non-updatable view consists of a query expression or query
specification containing any of the following:
DISTINCT clause
GROUP BY clause
Aggregate function
A select-list item that is not a base table.
Function
Syntax 1
Syntax 2
Permissions
Side effects
See also
Description

Table of Contents

Related product manuals