COMPARE

2023-10-31 11:17:11  Updated

The COMPARE function compares two RAW values. If the two values are different in length, the shorter RAW value is extended on the right based on the optional pad parameter.

Applicability

This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL mode.

Syntax

UTL_RAW.COMPARE (
     r1  IN RAW,
     r2  IN RAW,
     pad IN RAW DEFAULT NULL)
  RETURN NUMBER;

Parameters

Parameter Description
r1 The first RAW value to be compared, which may be NULL or 0 in length.
r2 The second RAW value to be compared, which may be NULL or 0 in length.
pad An optional parameter. It is used to extend either r1 or r2, whichever has fewer bytes. Default value: x'00'.

Return values

Return value Description
NUMBER The value is 0 if the byte strings of the two RAW values are both NULL or identical. Otherwise, the value is the position of the first unmatched byte, where the positions are numbered starting from 1.

Contact Us