----------  Insert  ----------

Data may be inserted into a table via: a single  non-interactive  command;  an
operating  system  file; an Interactive Interface with attribute value prompt-
ing; or a selection from an existing table.

1) To insert data non-interactively, use one of:

Syntax:

a)   insert [into] TABLE set ATTR_NAME |to| |VALUE          |
                                       |= | |null           |
                                            |SCALAR_SUBQUERY|

                          {, ATTR_NAME |to| |VALUE          | };
                                       |= | |null           |
                                            |SCALAR_SUBQUERY|

b)   insert [into] TABLE  [(ATTR_NAME  {, ATTR_NAME})]

          | values  (|EXPR |              {, |EXPR            |})  |;
          |          |null |                 |null            |    |
          |          |SCALAR_SUBQUERY |      |SCALAR_SUBQUERY |    |
          |                                                        |
          | |EXPR            |   {, |EXPR            |  }  [end]   |
          | |null            |      |null            |             |
          | |SCALAR_SUBQUERY |      |SCALAR_SUBQUERY |             |
          |                                                        |
          | values  |EXPR            |   {, |EXPR             |}   |
          |         |null            |      |null             |    |
          |         |SCALAR_SUBQUERY |      |SCALAR_SUBQUERY  |    |
          |                                                        |
          | set to  |EXPR            |   {, |EXPR             |})  |
          |         |null            |      |null             |    |
          |         |SCALAR_SUBQUERY |      |SCALAR_SUBQUERY  |    |

c)   insert [into] TABLE set    | *                        |
                                | (ATTR_NAME {, ATTR_NAME})|

          |   |EXPR            | {, |EXPR            | }  [end]    |
          |   |null            |    |null            |             |
          |   |SCALAR_SUBQUERY |    |SCALAR_SUBQUERY |             |
          |                                                        |
          | values |EXPR            |  {, |EXPR            | }     |
          |        |null            |     |null            |       |
          |        |SCALAR_SUBQUERY |     |SCALAR_SUBQUERY |       |
          |                                                        |
          | values (|EXPR            | {, |EXPR            |})     |
          |         |null            |    |null            |       |
          |         |SCALAR_SUBQUERY |    |SCALAR_SUBQUERY |       |

EXPR is either any legal value for the given attribute or the phrase
"direct_from FILENAME".

2) To insert data from an operating system file, use:

Syntax:

     insert [into] TABLE [ | (*)                         | ] from FILE;
                           | (ATTR_NAME {, ATTR_NAME})   |
                           | set *                       |
                           | set ATTR_NAME {, ATTR_NAME} |

The FILE may be set up as one record per line with attribute values  separated
by control-V's (default), or one attribute value per line.  If ATTR's are set,
it is essential they appear in the same order as in FILE.

3) To insert data via the Interactive Interface, use one of:

Syntax:

a)   insert [into] TABLE;

b)   insert [into] TABLE |(*)            |;
                         |(ITEM {, ITEM})|

c)   insert [into] TABLE |set ||*            | {[:] |set ||*            |};
                         |show||ITEM {, ITEM}|      |show||ITEM {, ITEM}|

ITEM is ATTR_NAME [print HEADER]

If only "insert TABLE" is specified, all attributes of TABLE will be  prompted
for  in the default order.  If a list of attributes is specified, they will be
prompted for values in that order.  Using "*" prompts for  all  attributes  in
the  table.   The  keyword "set" allows values to be entered while "show" only
displays the attribute name.

For further information on Interactive Interface commands, enter:

        help ia_insert;

4) To insert data from existing tables, use:

Syntax:

     insert [into] TABLE [ | (*)                         | ]
                           | ( ATTR_NAME {, ATTR_NAME} ) |
                           | set *                       |
                           | set ATTR_NAME {, ATTR_NAME} |

     select [|distinct|] [| *                            |]
             |all     |   | SELECT_ITEM {, SELECT_ITEM } |

     from TABLE [ [alias] ALIASNAME] {, TABLE [ [alias] ALIASNAME]}

     [WHERE_CLAUSE] [group by ATTR {ATTR}] [SORT_CLAUSE];

Note that "unique" is a synonym for "distinct".

This version inserts the data selected from the second TABLE(s) into the first
TABLE.   The  target TABLE is created if it does not exist.  If the "group by"
clause is used, the output must consist of rows only.

For further information, enter:

	help scalar_subquery
        help select;
        help sort;
        help where_clause;
