Loading Data

Use the LOAD statement from SQL Editor panel to insert data from an operating-system file into an existing table, synonym, or view.

Syntax

LOAD FROM 'filename '  DELIMITER 'delimiter 'INSERT INTO <table/view/synonym name> (column1,column2 ...)

column Name of a column or columns that receive data values from the load file during the load operation You must specify the columns that receive data if you are not loading data into all columns. You must also specify columns if the order of the fields in the load file does not match the default order of the columns in the table (the order established when the table was created).

delimiter Quoted string that identifies the character to use to separate the data values in each line of the load file. The default delimiter is the vertical bar (|). You cannot use any of the following characters as a delimiter character: backslash(\),  newline character (=CTRL-J),and hexadecimal numbers, (0-9, a-f, A-F).

Usage

The LOAD statement appends new rows to the table. It does not overwrite existing data.

You cannot add a row that has the same key as an existing row. To use the LOAD statement, you must have Insert privileges for the table where you want to insert data.

LOAD FROM File

The LOAD FROM file contains the data to add to a table. You can use the file that the UNLOAD statement creates as the LOAD FROM file. If you do not include a list of columns in the INSERT INTO clause, the fields in the file must match the columns that are specified for the table in number, order, and data type.

Each line of the file must have the same number of fields. You must define field lengths that are less than or equal to the length that is specified for the corresponding column. Specify only values that can convert to the data type of the corresponding column.

For additional information on LOAD FROM command, see Informix SQL Syntax Guide.