Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Unloading user data with UNLOAD

Using the utility statement UNLOAD, the database administrator can write user data from a table in a SESAM/SQL database to a SAM file of variable-length records. The database administrator can choose

  • whether SESAM/SQL specifies the format (standard format)

  • whether he/she specifies the format for the output file him-/herself (user defined format)

  • whether the output file is to be created in delimiter format

  • whether the output file is to be created in CSV format

  • whether the output file is to be created as a transfer file

  • whether the output file is to be created in the UNLOAD_FORMAT that will allow it to be used as an input file with the utility statement LOAD.

The output file is created with coded character set name (CCSN). If necessary, the data to be output in DELIMITER_FORMAT, in CSV format and in self-defined format is converted to the output file’s coded character set. In CSV format the column names can also be output (in the first line).

You can output entire tables (UNLOAD TABLE) or also data from selected columns of the table (UNLOAD DATA).

UNLOAD ONLINE enables you to unload user data from base tables or views. The data which is to be output can also be restricted by a search condition, and a collation sequence can be defined for the output file.

UNLOAD OFFLINE enables you to unload user data from base tables. In addition, you can output data:

  • a user space that could not be repaired FROM SPACE clause, user space is in the state “recover pending”).

  • a backup copy (FROM COPY_FILE clause)

Error file in the case of UNLOAD

In the case of UNLOAD, SESAM/SQL creates a new file if required or updates an existing file. The file has the following name:

catalog.space.EXC.U
file.EXC.U

in the case of UNLOAD OFFLINE and
in the case of UNLOAD ONLINE

catalog

space

is the name of the database.

Name of the user space containing the table into which the records are to be loaded. In the case of a partitioned table the space name of the first partition is used. The error file contains the error information for all partitions in the table.

file

Name of the file which is specified in the INTO FILE clause.

New entries are appended to an existing exception file. The entries from different UNLOAD statements are separated by a header line. If an exception file contains at least one record, a warning is issued.