INSERT

Advantage SQL Engine

Adds row of data to the table

Syntax

INSERT INTO <table-name> [(<column-identifier>[, <column- identifier >]…)]

VALUES (<data-values>[, <data-values>]…)

Or

INSERT INTO <table-name> [(<column- identifier >[, <column- identifier >]…)] query-specification

 

data-values ::= dynamic-parameter | literal | NULL | expression | USER

query-specification ::= SELECT  [ALL | DISTINCT] <select-list> FROM <table-reference-list>

 [WHERE <search-condition>]

 [GROUP BY <grouping-column>[, <grouping-column]…]

 [HAVING <search-condition>]

dynamic-parameter ::= ? | :<identifier>

search-condition ::= expression with a logical result

Remarks

Expression is any valid expression resulting in a non-boolean.

<identifier> is a named parameter.

Example(s)

INSERT INTO sal VALUES (34086, 'Chris Isaac', 45000.00, '1992-05-25')

INSERT INTO sal (emp_id, salary) VALUES (21586, 31500.50)

INSERT INTO cust_report SELECT DISTINCT * FROM cust WHERE state = ‘CA’

INSERT INTO ts VALUES( {ts '1999-03-19 13:45:33.013'} )

INSERT INTO ts VALUES( now() )

INSERT INTO expire (expiretime) VALUES( TIMESTAMPADD( SQL_TSI_DAY, 30, now() ))