Background documentationData Stream Locate this document in the navigation structure

 

Loader exports the data from databases into data streams or imports data from data streams into databases. The data can be transformed during this process. A range of syntax elements is available for describing the data stream. These syntax elements can be used in the export and import commands.

Structure

You can specify the data carrier type as well as the name of the data stream. You can also transfer formats and, if necessary, include other information to describe the data stream in more detail.

  • You enter the keyword OUTSTREAM to specify that the data is to be exported from a SAP MaxDB database to a data stream.

  • You enter the keyword INSTREAM to specify that the data is to be imported from a data stream to a SAP MaxDB database.

Syntax Syntax

  1. <outstream_columnformat_spec> ::=
      OUTSTREAM [<mediumtype_spec>] '<stream_name>'
        [<column_dataformat_spec>] [<start_spec>]
    <instream_columnformat_spec> ::=
      INSTREAM [<mediumtype_spec>] '<stream_name>'
        [<column_dataformat_spec>] [<start_spec>]
    
    <outstream_tableformat_spec> ::=
      OUTSTREAM [<mediumtype_spec>] '<stream_name>'
        [<table_dataformat_spec>]
    <instream_columnformat_spec> ::=
      INSTREAM [<mediumtype_spec>] '<stream_name>'
        [<table_dataformat_spec>]
End of the code.

It may be necessary to specify the format of the data stream (keywords CSV, DDL, FWV [BINARY], PAGES, RECORDS).

Syntax Syntax

  1. <outstream_csv_spec> ::=
      OUTSTREAM [<mediumtype_spec>] '<stream_name>'
        [CSV [<csv_format_spec> ...]] [<start_spec>]
    <instream_csv_spec> ::=
      INSTREAM [<mediumtype_spec>] '<stream_name>'
        [CSV [<csv_format_spec> ...]] [<start_spec>]
    
    <outstream_ddl_spec> ::=
      OUTSTREAM [<mediumtype_spec>] '<stream_name>' DDL
    <instream_ddl_spec> ::=
      INSTREAM [<mediumtype_spec>] '<stream_name>' DDL
    
    <outstream_fwv_spec> ::=
      OUTSTREAM [<mediumtype_spec>] '<stream_name>'
        FWV [<fwv_format_spec> ...] [<start_spec>]
    <instream_fwv_spec> ::=
      INSTREAM [<mediumtype_spec>] '<stream_name>'
        FWV [<fwv_format_spec> ...] [<start_spec>]
    
    <outstream_pages_spec> ::=
      OUTSTREAM [<mediumtype_spec>] '<stream_name>' PAGES
    <instream_pages_spec> ::=
      INSTREAM [<mediumtype_spec>] '<stream_name>' PAGES
    
    <outstream_records_spec> ::=
      OUTSTREAM [<mediumtype_spec>] '<stream_name>'
        RECORDS [<records_format_spec> ...]
    <instream_records_spec> ::=
      INSTREAM [<mediumtype_spec>] '<stream_name>'
        RECORDS [<records_format_spec> ...]
End of the code.
Syntax Elements

<mediumtype_spec>

Data carrier type

<stream_name>

Name and path of the data stream

CSV

CSV (Comma Separated Values) is a format for CHAR data in which a data line must at least be long enough to represent the data. The assignment of a data field of the data stream to a column in the table is defined by the position specification.

FWV

FWV (Fixed Width Values) is a format for plain text values in which a data line in the data stream corresponds to a data record. The assignment between data fields in the data stream and table columns is defined by the position specification.

FWV BINARY

FWV BINARY (Fixed Width Values BINARY) is a format for binary values in which all data fields have the same fixed length. The assignment between the data fields in the data stream and the table columns is defined by the position specification. Unlike the FWV format, a data record does not end with an additional line break.

PAGES

Format that specifies that the application data is stored in pages

RECORDS

Database format

DDL

DDL (Data Definition Language) is a format that can be specified for a data stream with database catalog data

<column_dataformat_spec>

<table_dataformat_spec>

<csv_format_spec>

<fwv_format_spec>

<records_format_spec>

Data Format

<start_spec>

Syntax Syntax

  1. <start_spec> ::=
      START <unsigend_integer> [MAXROWS]
    | START <unsigend_integer> [MAXRECORDS]
    | START <unsigend_integer> <unsigend_integer>
End of the code.

Export: the area defined by start_spec is exported from a table.

Import: the area defined by start_spec is imported from the data stream.

You can specify the starting point of the area (START <unsigend_integer> [MAXROWS] or START <unsigend_integer> [MAXRECORDS]) or the upper and lower limits for the area (START <unsigend_integer> <unsigend_integer>).

For more information see CSV, FWV, FWV BINARY, PAGES, RECORDS. If you are handlingLOB values, you need to adhere to syntax rules outstream_lob_spec and instream_lob_spec.

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

Data streams for the database catalog information of the application data (keyword CATALOG)

Syntax Syntax

  1. <catalog_outstream_spec> ::=
      CATALOG <outstream_ddl_spec>
    <catalog_instream_spec> ::=
      CATALOG <instream_ddl_spec>
    
End of the code.

Data streams for the application data (keyword DATA)

Syntax Syntax

  1. <data_outstream_column_spec> ::=
      DATA <outstream_columnformat_spec> [<export_lobcolumn_spec> ...]
    <data_outstream_part_spec> ::=
      DATA <outstream_tableformat_spec>
    <data_outstream_table_spec> ::=
      <data_outstream_part_spec>
    | <data_outstream_column_spec>
    
    <data_instream_column_spec> ::=
      DATA <instream_tableformat_spec>
    <data_instream_columns_spec> ::=
      DATA <instream_columnformat_spec>
        [<import_column_spec> ... <import_lobcolumn_spec> ...] [<usage_spec>]
    <data_instream_part_spec> ::=
      DATA <instream_tableformat_spec>
    <data_instream_table_spec> ::=
      <data_instream_part_spec>
    | <data_instream_columns_spec>
    
End of the code.

The application data of selected tables can be excluded from the export or import (keyword CONFIGURATION)

Syntax Syntax

  1. <configuration_spec> ::=
      CONFIGURATION <instream_csv_spec>
    
End of the code.

Data stream with the entries from the TRANSFORMATIONMODEL system table (keyword PACKAGE)

Syntax Syntax

  1. <package_spec> ::=
      PACKAGE <outstream_csv_spec>
    
End of the code.

Example

Example Example

IMPORT TABLE hotel.room

  DATA INSTREAM 'room_csv.data'

End of the example.

The application data (DATA) stored in the room_csv.data data stream (INSTREAM) is imported (IMPORT) to the ROOM table in the HOTEL schema. The data carrier type for the room_csv.data data stream is a file (FILE, default value). The format of the data stream is CSV (default value).

Loader Tutorial, Exporting, Importing