skip to main content

Embedded SQL Statements : INSERT

INSERT
The INSERT statement allows to add new rows into a table.
General format
EXEC SQL [AT Database]
  INSERT Options [ VALUES ( {Insert-Value} ... ) ]
  END-EXEC
Syntax rules
1.
Options is passed to the driver without further checks. Refer to the database documentation for detailed syntax. Syntax errors, if any, are returned at runtime.
2.
Insert-Value can be a host variable or a Nonnumeric Literal, as defined in the Definitions section of the Preface of this document.
General rules
1.
When Host-Variable is a host variable declared as a group-item, the runtime can use all subordinate items as separate values instead of using the group-item as a single value. To enable this feature, compile with the -cghv option.
2.
Database identifies the active connection that will execute the query and must be previously defined using a Format 4 DECLARE statement.
Examples
Inserting rows on a customers table
exec sql insert into customers values (10, 'Adam Smith') end-exec
exec sql insert into customers values (20, 'Eve Scott') end-exec

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left