[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|          INSERT - SQL           |
+---------------------------------+
INSERT INTO <dbf_name>
        [(<fname1> [, <fname2>
                [, ...]])]
        VALUES (<expr1> [, <expr2>
                [, ...]])

INSERT INTO <dbf_name>
        FROM ARRAY <array>
        FROM MEMVAR

-----------------------------------
INSERT appends a record to the end of a database.
-----------------------------------

INSERT appends a record to the end of an existing database.  The new
record includes data listed in the INSERT command, data included in the
specified array or data from memory variables.

INSERT INTO <dbf_name>
        In this clause, <dbf_name> specifies the name of the database to which
a record will be appended.  The <dbf_name> can include a path and can be
a name expression.

[(<fname1> [, <fname2> [, ...]])]
VALUES (<expr1> [, <expr2>[, ...]])
        This clause specifies data values (<expr1>, <expr2>, ... ) to include
in the record that is being added to the database.  You must specify
values in the order defined by the database structure unless you specify
field names.

        If you specify field names using <fname1>, <fname2>, etc., you can list
the field names in any order.  Each <fname> can be a name expression.

FROM ARRAY <array>
        In this clause, <array> is the name of an existing array containing
data for the record being added.

FROM MEMVAR
        FROM MEMVAR copies data from memory variables into the new record in
the database specified by <dbf_name>.  Data is only copied into fields
that have corresponding memory variables.  If memory variables only
exist for certain fields in <dbf_name>, fields without corresponding
memory variables remain empty.

+---------------------------------+
|             Example             |
+---------------------------------+
INSERT INTO parts (pno, descript,;
onhand, onorder, price, cost) ;
VALUES ('B6722', 'Royal Reindeer',;
         2, 6, 27.99, 20.65)

USE  customer
COPY STRUCTURE TO cust2
SCATTER  MEMVAR
INSERT INTO cust2 FROM MEMVAR

-----------------------------------

See Also:  CREATE QUERY, CREATE TABLE - SQL, MODIFY QUERY, SELECT - SQL,
SQL

-----------------------------------

See Also: CREATE QUERY CREATE TABLE - SQL MODIFY QUERY SELECT - SQL
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson