Bulk-Export
Bulk-Export
Derby provides two export procedures you can use to perform bulk-export operations:
- To export all the data from a table to a file, use the SYSCS_UTIL.SYSCS_EXPORT_TABLE procedure. The procedure definition is:
SYSCS_UTIL.SYSCS_EXPORT_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))
No Result is returned from the procedure.
- To export the result of a SELECT statement to a file, use the SYSCS_UTIL.SYSCS_EXPORT_QUERY procedure. The procedure definition is:
SYSCS_UTIL.SYSCS_EXPORT_QUERY(IN selectStatement VARCHAR(32672), IN tableName VARCHAR(128), IN fileName VARCHAR(32672), IN columnDelimiter CHAR(1), IN characterDelimiter CHAR(1), IN codeset VARCHAR(128))
No result is returned from the procedure.
Arguments to the export procedure
-
schemaName
Specifies the schema of the table. You can pass a NULL value to use the default schema name.
-
selectStatement
Specifies the SELECT statement query that returns the data to be exported. Passing a NULL value will result in an error.
-
tableName
Specifies the table name of the table or view from which the data is to be exported. This table cannot be a system table or a declared temporary table. The string must exactly match case of the table name. Passing a null will result in an error.
-
fileName
Specifies the file to which the data is to be exported. If the path is omitted, the current working directory is used. If the name of a file that already exists is specified, the export utility overwrites the contents of the file; it does not append the information. The specified location of the file should refer to the server-side location if using the Network Server. Passing a null will result in an error.
-
columnDelimiter
Specifies a column delimiter. The specified character is used in place of a comma to signify the end of a column. You can pass a NULL value to use the default value of a comma.
-
characterDelimiter
Specifies a character delimiter. The specified character is used in place of double quotation marks to enclose a character string. You can pass a NULL value to use the default value of a double quotation mark.
-
codeset
Specifies the code set of the data in the export file. The code set name should be one of the Java-supported character encoding sets. Data is converted from the database code page to the specified code page before writing to the file. You can pass a NULL value to write the data in the same code page as the JVM in which it is being executed.
Previous Page
Next Page
Table of Contents
Index