Export table data or table schema

The Unload utility has options that allow you to unload only table data or the table schema.

Prerequisites

You must be the owner of the table or have DBA authority.

Context and remarks

The statements required to recreate the schema and reload the specified tables are written to reload.sql in the local current directory.

You can unload more than one table by separating the table names with a comma delimiter.

 Export table data (command line)
  • Run the dbunload command, specifying: connection parameters using the -c option, table(s) you want to export data for using the -t option, and whether you want to unload only data by specifying the -d option.

    For example, to export the data from the Employees table, run the following command:

    dbunload -c "DBN=demo;UID=DBA;PWD=sql" -d -t Employees C:\MyDirectory
 Export table schema (command line)
  • Run the dbunload command, specifying: connection parameters using the -c option, the table(s) you want to export data for using the -t option, and whether you want to unload only the schema by specifying the -n option.

    For example, to export the schema for the Employees table, run the following command:

    dbunload -c "DBN=demo;UID=DBA;PWD=sql" -n -t Employees C:\MyDirectory

Results

The table data, or table schema, are exported to the specified directory.

Next

None.