2.7.4 Rules common to predicates

  1. For types of data that can be compared, see 1.2.2 Data types that can be converted (assigned or compared). However, if a character string literal is specified as an object of comparison of national character data, the character string literal is treated as a national character literal. If a character string literal is treated as a national character string literal, the character data receives a length check only, and the character code is not checked.
  2. When comparing fixed-length data with fixed-length data, or fixed-length data with variable-length data, HiRDB space-fills the shorter data item on the right, and performs the comparison after making the character strings equal in length.
  3. When comparing two variable-length character data items of different lengths, HiRDB performs the comparison from the left, for a length equal to the length of the shorter data item. If the results are equal, HiRDB further compares the character string lengths.
  4. When comparing two numeric data items of different data types, HiRDB performs the comparison by using the data type of the wider range. Different numeric data types have the following range widths:
    FLOAT > SMALLFLT > DECIMAL > INTEGER > SMALLINT
    If one of the items to be compared with is the SMALLFLT, it is compared as a FLOAT type irrespective of the width of its range.
  5. When comparing two time stamp data items of different fractional second precisions, HiRDB extends the fractional precision of the lower precision item to match the precision of the higher precision item, and zero-fills the extended fractional second part.
  6. When comparing two BINARY type items of different data lengths, HiRDB performs the comparison from the left, for a length equal to the length of the shorter data item. If the results are equal, HiRDB further compares the data lengths.