Background documentationSelecting Data Records Locate this document in the navigation structure

 

When importing application data, you can select the data records to be imported. The conditions used in the selection can be negated with NOT, linked with AND and OR, and bracketed. Loader evaluates the operators accordingly.

Structure

Syntax Syntax

  1. <if_condition> ::=
      IF <condition>
    
    <condition> ::=
      (<condition>)
    | <condition> AND <condition>
    | <condition> OR <condition>
    | NOT <condition>
    | <simple_condition>
    
    <simple_condition> ::=
      POS <field_spec> <field_type> [HEX] 
        <compare_operator> '<literal>'
    
    <compare_operator> ::=
      <
    | >
    | =
    | <=
    | >=
    | !=
End of the code.

Loader distinguishes between compound conditions and simple conditions (simple_condition). Only records for which the compound or simple condition applies are imported.

Compound Conditions

Conditions can be negated with NOT, combined with AND and OR to form compound conditions, and bracketed. Operators in parentheses are evaluated before those that are not in parentheses. If no operators are in parentheses, Loader weights them as follows:

  • NOT takes precedence over AND and OR.

  • AND takes precedence over OR.

  • If the weighting is identical, the operators are evaluated from left to right.

Simple Conditions

You use the simple condition simple_condition to define the selection criteria that determine which records in the data stream are imported to which target table. The data records that you want to import are selected by comparing them to a constant.

<field_spec>

You describe the a value to be compared in a data record with its position.

<field_type>

The data type only has to be specified if the affected data field is to be read or output with a data type other than CHAR. Every internal database column format in the database can be read and output in CHAR format.

HEX

You can define HEX values.

<literal>

The literal specified is a constant that is used as a comparison value. You specify a literal as a plain text value and place it in single quotation marks. This value is converted to the data type of the value that you want to compare in the data record. If the literal you want to use as a comparison value is a number, it must have a valid number format. That is, it must be a floating point number in mantissa/exponent notation or a fixed-point number with the defined decimal representation, or the default decimal representation that is predefined in the Loader.

Example

Example Example

IMPORT TABLE hotel.room

IF POS 06-11 = 'double'

DATA INSTREAM 'room_fwv.data' FWV

  hno     01-05

  type    06-11

  free    12-15

  price  16-22

End of the example.

You only import those data records in which double is specified as the room type from the room_fwv.data source data stream into the ROOM table.