Using the Bulk Import and Export Utilities
Page 4 of 12

Bulk Import and Export Stand-Alone Utilities

The syntax for the standalone bulk-import utility is:

java [-D  importProperties ] COM.cloudscape.tools.FileImport 
databaseConnectionURL tableName inputOrExportFileURL
[ controlFileURL]

The syntax for the standalone bulk-export utility is:

java COM.cloudscape.tools.FileExport   databaseConnectionURL 
tableOrViewName inputOrExportFileURL [ controlFileURL]

NOTE: You can set system properties such as cloudscape.system.home on the command line using parameters to the java command.

Arguments to Import and Export Utility Commands

  • databaseConnectionURL

    The Cloudscape database connection URL (string) for the database containing the table.

  • tableName

    The name of the table into which you want to bulk-import the data. Qualify the table name with the schema name if it is not in the default schema APP.

  • tableOrViewName

    The name of the table or view from which you want to bulk-export the data. Qualify the table name with the schema name if it is not in the default schema APP.

  • inputOrExportFileURL

    The path or the URL of the ASCII file from which to bulk-import or bulk-export the data. If a controlFileURL is not specified, the import or export file must be of the default file format (see Default Input or Output File Format). If a controlFileURL is specified, it must be of the input format described by the control file.

    The path separator in the path or the URL is / (forward slash), per the standard file:// URL protocol. Absolute or relative paths are accepted.

    For local files, do not use the file:// protocol; omit the protocol altogether.

    For export, only the http:// protocol is not allowed. Import supports http://.

  • controlFileURL

    The path or URL of the control file specifying the file format of the ASCII file for the bulk import or export.

  • importProperties

    The properties for the bulk load. See Import Properties. By default, the insertMode property is set to bulkInsert. This property is ignored if the requirements for fast mode are not fulfilled. See Fast Mode Requirements. (Where appropriate, you can also specify other properties such as cloudscape.system.home, cloudscape.ui.locale, or cloudscape.ui.codeset.)

Bulk Import and Export Utility Examples

NOTE: Type commands on a single line, with no carriage returns.

java COM.cloudscape.tools.FileImport jdbc:cloudscape:toursDB
APP.myints c:/mydata/mydata.dat

Imports c:\mydata\mydata.dat into the table myints in the schema APP in the database toursDB.

java -DinsertMode=replace COM.cloudscape.tools.FileImport
    jdbc:cloudscape:wombat APP.abc ../mydata/mydata2.dat
    ../mydata/mydata.ctl

Imports mydata2.dat into the table in abc in the schema APP, replacing existing data and running in fast mode in the database wombat using the control file c:\data\myData.ctl.

java -Dcloudscape.system.home=c:\mydatabases
COM.cloudscape.tools.FileImport
jdbc:cloudscape:toursDB Flights
http://airlines.com/data/flight.info

Imports flight.info via HTTP into the table Flights in the database toursDB, which is located in the specified system directory.

java COM.cloudscape.tools.FileExport jdbc:cloudscape:wombat
APP.abc c://mydata/mydata3.dat

Exports data from table or view abc in database wombat to file c:\mydata\mydata3.dat, using the default format (since no control file is specified).

java COM.cloudscape.tools.FileExport jdbc:cloudscape:wombat
APP.abc c:/mydata/mydata4.dat c:/mydata/mydata.ctl

Exports from table or view abc in database wombat to file mydata4.dat using the file format described in mydata.ctl.