# Bulk import/export requirements and considerations

The table must exist
  For you to import data into a table, the table must already exist in Derby. The table does not have to be empty. If the table is not empty, bulk import performs single inserts which results in slower performance.
Create indexes and primary key, foreign key, and unique constraints first
  To avoid a separate create index step, create indexes and primary keys on tables before you import data. However, if your memory and disk spaces resources are limited, you can build the indexes and primary keys after importing data.
Data types
  You can import and export only data of the non-binary, built-in data types. Derby implicitly converts the strings to the data type of the receiving column. If any of the implicit conversions fail, the whole import is aborted. For example, "3+7" cannot be converted into an integer. An export that encounters a runtime error stops.
  Note: You cannot import or export the binary data types: BLOB, CLOB, CHAR FOR BIT DATA, VARCHAR FOR BIT DATA, or LONG VARCHAR FOR BIT DATA. Additionally, you cannot import or export the XML data type.
Locking during import
  Import procedures use the same isolation level as the connection in which they are executed to insert data into tables. During import, the entire table is exclusively locked irrespective of the isolation level.
Locking during export
  Export procedures use the same isolation level as the connection in which they are executed to fetch data from tables.
Import behavior on tables with triggers
  The import procedure fires INSERT triggers when data is appended to the table. The REPLACE option is not allowed when triggers are enabled on the table.
Restrictions on the REPLACE option
  If a table that receives imported data already contains data, you can either replace or append to the existing data. You can use the REPLACE option on tables that have dependent tables, but the replaced data must maintain referential integrity, otherwise the import operation will be rolled back. You cannot use the REPLACE option if the table has enabled triggers.
Restrictions on tables
  You cannot use import procedures to import data into a system table or a declared temporary table.

Parent topic: Bulk Import/Export overview
Related concepts
Options for running the import and export procedures