Skip to main content

Importing Data with LOAD DATA

Importing Data with LOAD DATA

You can import data into InterSystems IRIS using the LOAD DATA SQL command. This utility can be used to import data either from a file or from a table accessed with JDBC. Before calling LOAD DATA, you must first use CREATE TABLE to define the table and its columns.

If the table is empty when loading data, LOAD DATA populates the table with rows from the data source. If the table already contains data, LOAD DATA inserts rows into the table without overwriting any data in the table.

The following example creates a table and loads data into it using a file stored on a local system, named people.csv:

>>> CREATE TABLE Sample.Person (
        Name VARCHAR(25),
        Age INT,
        DOB DATE)

>>> LOAD DATA FROM FILE 'C://sampledata/people.csv' INTO Sample.Person

LOAD DATA also provides options for speeding up the loading operation through use of the BULK keyword. Refer to the LOAD DATA reference for a full description of this behavior.

FeedbackOpens in a new tab