The COMPARE function compares two RAW values. If their lengths are different, the shorter RAW value is extended on the right by using the optional pad parameter.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
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. It can be NULL or have a length of 0. |
| r2 | The second RAW value to be compared. It can be NULL or have a length of 0. |
| pad | An optional parameter. It specifies the value to be used to extend the shorter of r1 or r2. The default value is x'00'. |
Return value
| Return value | Description |
|---|---|
| NUMBER | 0 if both RAW values are NULL or the same. Otherwise, it is the position of the first mismatched byte, starting from 1. |
