background image
<< File format for input and output | Parameters for the import procedures >>

Importing data using the built-in procedures

<< File format for input and output | Parameters for the import procedures >>
Derby Server and Administration Guide
70
"The boot has a 3""heel."
The following example file shows four rows and four columns in the default file format:
1,abc,22,def
22,,,"a is a zero-length string, b is null"
13,"hello",454,"world"
4,b and c are both null,,
The export procedure outputs the following values:
1,"abc",22,"def"
22,,,"a is a zero-length string, b is null"
13,"hello",454,"world"
4,"b and c are both null",,
Importing data using the built-in procedures
You can use the Derby import procedures to import all of the data from a table or query,
or to import LOB data separately from the other data.
1. Use the following table to choose the correct procedure for the type of import that
you want to perform. For examples of these procedures, see
Examples of bulk
import and export
.
Table 10.
Using the built-in import procedures
Type of Import
Procedure to Use
To import all the data to
a table, where the import
file contains the LOB data
SYSCS_UTIL.SYSCS_IMPORT_TABLE
(IN
SCHEMANAME
VARCHAR(128),
IN
TABLENAME
VARCHAR(128),
IN
FILENAME
VARCHAR(32672),
IN
COLUMNDELIMITER
CHAR(1),
IN
CHARACTERDELIMITER
CHAR(1),
IN
CODESET
VARCHAR(128),
IN
REPLACE
SMALLINT)
To import the data
to a table, where the
LOB data is stored in
a separate file and the
main import file contains
all of the other data with
a reference to the LOB
data
SYSCS_UTIL.SYSCS_IMPORT_TABLE_LOBS_FROM_EXTFILE
(IN
SCHEMANAME
VARCHAR(128),
IN
TABLENAME
VARCHAR(128),
IN
FILENAME
VARCHAR(32672),
IN
COLUMNDELIMITER
CHAR(1),
IN
CHARACTERDELIMITER
CHAR(1),
IN
CODESET
VARCHAR(128),
IN
REPLACE
SMALLINT)
The import utility looks in the main import file for a
reference to the location of the LOB data. The format
of the reference to the LOB stored in the main import
file must be
lobsFileName.Offset.length/
.
To import data from a file
to a subset of columns in
a table, where the import
file contains the LOB data
SYSCS_UTIL.SYSCS_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)
You must specify the INSERTCOLUMNS parameter
on the table into which data will be imported. You