COMPARE v16

The COMPARE procedure performs an exact byte-by-byte comparison of two large objects for a given length at given offsets. The large objects being compared must be the same data type.

<status> INTEGER COMPARE(<lob_1> { BLOB | CLOB },
   <lob_2> { BLOB | CLOB }
   [, <amount> INTEGER [, <offset_1> INTEGER [, <offset_2> INTEGER ]]])

Parameters

lob_1

Large object locator of the first large object to compare. Must be the same data type as lob_2.

lob_2

Large object locator of the second large object to compare. Must be the same data type as lob_1.

amount

If the data type of the large objects is BLOB, then the comparison is made for amount bytes. If the data type of the large objects is CLOB, then the comparison is made for amount characters. The default is the maximum size of a large object.

offset_1

Position in the first large object to begin the comparison. The first byte/character is offset 1. The default is 1.

offset_2

Position in the second large object to begin the comparison. The first byte/character is offset 1. The default is 1.

status

Zero if both large objects are exactly the same for the specified length for the specified offsets. Nonzero if the objects aren't the same. NULL if amount, offset_1, or offset_2 are less than zero.