SYSCS_UTIL.IMPORT_DATA

The SYSCS_UTIL.IMPORT_DATA system procedure imports data to a subset of columns in a table. You choose the subset of columns by specifying insert columns. This procedure is also used to import a subset of column data from a file by specifying column indexes.

Syntax

Note: If you execute this procedure on a connection that sets the skip-constraint-checks property to true, then GemFire XD uses the PUT INTO DML syntax instead of INSERT to import the data. In addition, GemFire XD ignores all primary key, foreign key, and unique constraints.
SYSCS_UTIL.IMPORT_DATA (IN SCHEMANAME VARCHAR(128),
IN TABLENAME VARCHAR(128), IN INSERTCOLUMNS VARCHAR(32672),
IN COLUMNINDEXES VARCHAR(32672), IN FILENAME VARCHAR(32672),
IN COLUMNDELIMITER CHAR(1), IN CHARACTERDELIMITER CHAR(1),
IN CODESET VARCHAR(128), IN REPLACE SMALLINT)

No result is returned from the procedure.

SCHEMANAME
An input argument of type VARCHAR(128) that specifies the schema of the table. Passing a NULL value will use the default schema name.
TABLENAME
An input argument of type VARCHAR (128) that specifies the table name of the table into which the data is to be imported. This table cannot be a system table or a declared temporary table. Passing a null will result in an error.
INSERTCOLUMNS
An input argument of type VARCHAR (32762) that specifies the column names (separated by commas) of the table into which the data is to be imported. Passing a NULL value will import the data into all of the columns of the table.
COLUMNINDEXES
An input argument of type VARCHAR (32762) that specifies the indexes (numbered from 1 and separated by commas) of the input data fields to be imported. Passing a NULL value will use all of the input data fields in the file.
FILENAME
An input argument of type VARCHAR(32672) that specifies the file that contains the data to be imported. If you do not specify a path, the current working directory is used. Passing a NULL value will result in an error.
COLUMNDELIMITER
An input argument of type CHAR(1) that specifies a column delimiter. The specified character is used in place of a comma to signal the end of a column. Passing a NULL value will use the default value; the default value is a comma (,).
CHARACTERDELIMITER
An input argument of type CHAR(1) that specifies a character delimiter. The specified character is used in place of double quotation marks to enclose a character string. Passing a NULL value will use the default value; the default value is a double quotation mark (").
CODESET
An input argument of type VARCHAR(128) that specifies the code set of the data in the input file. The name of the code set should be one of the Java-supported character encodings. Data is converted from the specified code set to the database code set (utf-8). Passing a NULL value will interpret the data file in the same code set as the JVM in which it is being executed.
REPLACE
A input argument of type SMALLINT. A non-zero value runs the procedure in REPLACE mode, while a value of zero runs the procedure in INSERT mode. REPLACE mode uses the PUT INTO DML syntax to insert rows without first checking primary key constraints. The table definition and the index definitions are not changed. INSERT mode adds the imported data to the table using the standard INSERT syntax, checking existing primary key values if necessary. Passing a NULL value causes an error.
Note: If you execute this procedure over a connection that sets the skip-constraint-checks property to true, then all inserts use the PUT INTO DML syntax regardless of what value you set for the REPLACE option.

If you create a schema, table, or column name as a non-delimited identifier, you must pass the name to the import procedure using all uppercase characters. If you created a schema, table, or column name as a delimited identifier, you must pass the name to the import procedure using the same case that was used when it was created.

Usage

For additional information and example usage for this procedure see Exporting and Importing Bulk Data from Text Files.

Example

The following example imports some of the data fields from a delimited data file called data.del into the STAFF table:
CALL SYSCS_UTIL.IMPORT_DATA
    (NULL, 'STAFF', null, '1,3,4', 'data.del', null, null, null,0)