LOAD statement

Use the LOAD statement to insert data from an operating-system file into an existing table or view.


Only DB-Access supports the LOAD statement.

Read syntax diagramSkip visual syntax diagram
>>-LOAD FROM--'filename'--+------------------------+------------>

>--INSERT INTO--+-table---+--+------------------+--------------><
                +-view----+  |    .-,------.    |   
                '-synonym-'  |    V        |    |   

Element Description Restrictions Syntax
column Column to receive data values from filename See INSERT INTO Clause. Identifier
delimiter Character to separate data values in each line of the load file. Default delimiter is the pipe ( | ) symbol. See DELIMITER Clause. Quoted String
filename Path and filename of file to read. Default pathname is current directory See LOAD FROM File. Specific to operating system rules
synonym, table, view Synonym for the table in which to insert data from filename Synonym and table or view to which it points must exist Database Object Name


This statement is an extension to the ANSI/ISO standard for SQL. You can use this statement only with DB-Access.

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. For information on database-level and table-level privileges, see the GRANT statement.

In a database that uses a nondefault locale, if the GL_DATETIME environment variable has a nondefault setting, the USE_DTENV environment variable must be set to 1 before the LOAD statement can correctly insert localized DATETIME values into a database table, or into a view, or into an object that the CREATE EXTERNAL TABLE statement defined. For more information on the GL_DATETIME, GL_DATE, DBTIME, and USE_DTENV environment variables, refer to the HCL Informix GLS User's Guide.

Copyright© 2021 HCL Technologies Limited