Background documentationNEXT STAMP Statement (next_stamp_statement) Locate this document in the navigation structure

 

The NEXT STAMP statement (next_stamp_statement) supplies a unique key that was generated by the database system.

Structure

Syntax Syntax

  1. <next_stamp_statement> ::=
      NEXT STAMP [INTO] <parameter_name>
End of the code.
Explanation

The database system is capable of generating unique values. These comprise a series of consecutive numbers starting at X'0000000000001'. The values are assigned in ascending order. There is no guarantee that a sequence of values is uninterrupted. These values can be stored in a column with the data type CHAR(n) BYTE with n>=8.

The NEXT STAMP statement assigns the next key generated by the database system to the variable denoted by parameter_name.

The NEXT STAMP statement can only be embedded in a programming language and cannot be used in interactive mode.

The keyword STAMP can also be used in an INSERT statement or an UPDATE statement if the next value is to be generated by the database system and stored in a column without the user knowing the value.