The INSERT statement inserts new rows into a table. You can insert as many rows as needed.
LSQL INSERT INTO tablename [(columnlist)][[VALUES(list)] [querystatement]]
Parameters
Column names that store the values that valuelist specified. If you do not specify columnlist values, the SQL server stores the values into the columns in the order in which they were defined on the CREATE TABLE statement for this table.
Query statement that retrieves the values to be inserted into the table. This query can be any valid search criteria.
Name of the table into which you are inserting a row.
Column values for the new row. A value can be a character string, a numeric string, or a host variable. Commas separate values in the list.
Notes:
Examples
LSQL INSERT INTO APPLICATIONS (APPL_ID,USER_ID,UPDATE,STATUS) VALUES ('APPL29','TSOUSR29', DATE '2002‑03‑13','UP')
Note: The DATE data type definition precedes the literal date value. See the description of the Select Statement for more details about the DATE, TIME, and TIMESTAMP data types. Also, that the column values match the order in which the columns appear in the table, so the column list could have been left out.
LSQL INSERT INTO APPLICATIONS (APPL_ID, STATUS) VALUES ('APPL29', 'UP')
INSERT INTO APPLICATIONS SELECT * FROM NEWAPPS WHERE USER_ID IN ('TSOUSR1', 'TSOUSR2', 'TSOUSR8')
Copyright © 2014 CA Technologies.
All rights reserved.
|
|