INSERT … VALUES
The VALUES
list must provide a value for every column in the column list, in the same order and of the correct type.The column list need not specify every column in the target but, if the column list is absent, the engine requires a value for every column in the table or view (computed columns excluded).
The expression DEFAULT
allows a column to be specified in the column list, but instructs Firebird to use the default value (either NULL
or the value specified in the DEFAULT
clause of the column definition).For identity columns, specifying DEFAULT
will generate the identity value.It is possible to include calculated columns in the column list and specifying DEFAULT
as the column value.
Note
|
Introducer syntax provides a way to identify the character set of a value that is a string constant (literal).Introducer syntax works only with literal strings: it cannot be applied to string variables, parameters, column references or values that are expressions. |
INSERT INTO cars (make, model, year)
VALUES ('Ford', 'T', 1908);
INSERT INTO cars
VALUES ('Ford', 'T', 1908, 'USA', 850);
-- notice the '_' prefix (introducer syntax)
INSERT INTO People
VALUES (_ISO8859_1 'Hans-Jörg Schäfer');