Entering content frame

Syntax documentation Data Stream Locate the document in the library structure

The Loader exports the data from databases into data streams or imports data from data streams into databases. The data can be transformed in this process.

A range of syntax elements are available for describing the data stream. These syntax elements can be used in the export and import commands.

Syntax

<outstream_spec> ::= OUTSTREAM [<mediumtype_spec>] '<valSTREAM_NAME>' [<stream_format_spec>] [<stream_extract>]

<instream_spec> ::= INSTREAM [<mediumtype_spec>] '<valSTREAM_NAME>' [<stream_format_spec>] [<stream_extract>] [<noheader_spec>]

·         You enter the keyword OUTSTREAM in the syntax rule outstream_spec to specify that the data is to be exported from a MaxDB database instance to a data stream.

·         You enter the keyword INSTREAM in the syntax rule instream_spec to specify that the data is to be imported from a data stream to a MaxDB database instance.

<mediumtype_spec>

Type of medium

The data is exported to the specified medium or imported from this medium.
If no medium is specified, a file (FILE) is selected as the medium.

<valSTREAM_NAME>

Name and path of the medium

<stream_format_spec>

Specification of the data format


The formats specified in the syntax rule 
stream_format_spec apply to the data. 

<stream_extract>

START <valSTART_POS> (MAXROWS | MAXRECORDS)
| START <valSTART_POS> <valEND_POS>
The syntax rule stream_extract is only evaluated for EXPORT TABLE  and IMPORT TABLE commands, if the data format is  RECORDS, COMPRESSED or FORMATTED. If you use this rule in other commands, it is ignored.

<valSTART_POS>

Number of the first data record to be imported

<valEND_POS>

Number of the last data record to be imported

<noheader_spec>

NOHEADER <valRECORD_LENGTH>
The syntax rule noheader_spec is only evaluated for IMPORT TABLE commands if the data format is FORMATTED BINARY. If you use this rule in other commands, it is ignored.

<valRECORD_LENGTH>

Length of an individual data record in the data stream

Examples

Example

IMPORT TABLE hotel.room 
DATA INSTREAM FILE 'room.data'

Data stream room.data is imported into table room. It contains application data.

Explanation

<stream_extract>

Syntax rule stream_extract is only evaluated for EXPORT TABLE and IMPORT TABLE-commands if the data format is RECORDS, COMPRESSED or FORMATTED.

The meaning varies for EXPORT and IMPORT commands: In the case of an import you can specify from which data record from a data file how many data records are to be loaded. In the case of an export you can specify from data record of a table how many data records are to be exported.

<noheader_spec>

The syntax rule noheader_spec is only evaluated for IMPORT TABLE commands if the data format is FORMATTED BINARY.

For data streams with binary values (FORMATTED BINARY) you can use noheader_spec to specify that the data stream does not have a special header containing the sizes of a data record. At the same time, you specify the length of an individual data record in the data stream.

If the data stream was generated with the EXPORT TABLE, it contains a special header with the length of an individual data record in the data stream.

If this header is missing, the Loader can use noheader_spec to specify the length of an individual data record. If this rule is missing, the Loader calculates the length of an individual data record using the information on the column positions in the load command.

Classification of the Data Streams

The keywords CATALOG, DATA, CONFIGURATION and PACKAGE are used in the commands for exporting and importing to differentiate by the type of data that is exported or imported.

<catalog_outstream_spec>

CATALOG <outstream_spec>

<catalog_instream_spec>

CATALOG <instream_spec>

Data streams for the database catalog definitions

<data_outstream_spec>

DATA <outstream_spec>

<data_instream_spec>

DATA <instream_spec>

Data streams for the application data

<configuration_instream_spec>

CONFIGURATION <instream_spec>

The application data of selected tables can be excluded from the export or import

<package_outstream_spec>

PACKAGE <outstream_spec>

Data streams with entries of system table TRANSFORMATIONMODEL

See also:

Exporting: Commands

Importing: Commands

Files

Data Types

 

Leaving content frame