Entering content frame

Background documentation Loading Constants and Special Constants Locate the document in its SAP Library structure

For column descriptions, you can use the syntax rule column_assignment to specify that a constant value is loaded into the specified column for each loaded data record, and which value this constant is to have.

In the command, enter the constant valLITERAL or the special constant generate_spec instead of a position specification. Now, data will not be loaded from the data stream for the appropriate column.

Note

If the data stream is empty, the constants specified in the command are not loaded.

Syntax

<column_assignment> ::= <valCOLUMN_NAME> '<valLITERAL>'
| <valCOLUMN_NAME> <generate_spec>

<generate_spec> ::= USER | USERGROUP
| DATE | TIME | TIMESTAMP | STAMP | TRUE | FALSE | <sequence_number>

<sequence_number> ::= SEQNO | SEQNO <valSTART>
| SEQNO <valSTART> <valINCREMENT>

valCOLUMN_NAME

Column name
Specify this according to the SQL conventions. It can also contain the table name as a prefix (such as, customer.cno).

valLITERAL

Constant

USER

Name of the current user is loaded

USERGROUP

Name of the group of the current user is loaded.

If this user is not assigned to a user group, the name of the current user is loaded.

The column into which you want to load one of these values must have the type CHAR (n) where n >= 32.

DATE

Current date

The column into which you want to load one of these values must have the type DATE.

TIME

Current time

The column into which you want to load one of these values must have the type TIME.

TIMESTAMP

Current timestamp

The column into which you want to load one of these values must have the type TIMESTAMP.

STAMP

A unique value generated by the database system that can only be loaded into columns of the type CHAR (n) BYTE where n >= 8.

TRUE

Boolean value TRUE

FALSE

Boolean value FALSE

valSTART

Start value and first value to be loaded

valINCREMENT

Increment between values to be loaded

Explanation

Loading Constants: <valCOLUMN_NAME> '<valLITERAL>'

To load a general constant, enter the required constant instead of a position. Place the value in single quotation marks.

The Loader treats the constant like a plain text value and converts it into the data type of the target column.

If you want to load the constant into a numeric column, it must have a valid numeric format.

Example

DATALOAD TABLE reservation
  rno        1
  cno        2
  hno        3
  type       4
  arrival    '2004-02-07'
  departure  '2004-02-20'
INSTREAM 'reservation.data'

Loading Special Constants: <valCOLUMN_NAME> <generate_spec>

<generate_spec>

You can load the special values USER, USERGROUP, DATE, TIME, TIMESTAMP, STAMP, TRUE, FALSE and sequence_number.

Example

DATALOAD TABLE reservation
  rno        1
  cno        2
  hno        3
  type       4
  arrival    DATE
  departure  5
INSTREAM 'customer.data'

<sequence_number>

You can use the syntax rule sequence_number to load automatically generated sequential numbers with a freely definable start value and increment.

The set of calculable numbers is cyclical. This means that the value that comes after the largest possible value is the smallest possible value. In this way, you can generate as many numbers as you want, including repeated sequential numbers.

SEQNO: sequential numbers are to be generated.  Both the start value and the increment can be negative.

If you only enter the keyword SEQNO in the command, the start value is 0 and the increment between values is 1.

If you only enter the start value in the command after SEQNO, the increment between the values is 1.

A column of the type FIXED(10) is sufficient for storing the sequential numbers.

Example

DATALOAD TABLE customer
  cno       
SEQNO 3000 100
  title     2
  firstname 3
  name      4
  zip       5
  address   6
INSTREAM 'customer.data'

 

Leaving content frame