如何在Oracle中比较两个CLOB值 [英] How do I compare two CLOB values in Oracle
本文介绍了如何在Oracle中比较两个CLOB值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要推荐两个桌子.列之一是CLOB类型.我想做这样的事情:
I have two tables I would like to complare. One of the columns is type CLOB. I would like to do something like this:
select key, clob_value source_table
minus
select key, clob_value target_table
不幸的是,Oracle无法对Clob执行减号操作.我该怎么办?
Unfortunately, Oracle can't perform minus operations on clobs. How can I do this?
推荐答案
格式为:
dbms_lob.compare(
lob_1 IN BLOB,
lob_2 IN BLOB,
amount IN INTEGER := 18446744073709551615,
offset_1 IN INTEGER := 1,
offset_2 IN INTEGER := 1)
RETURN INTEGER;
如果dbms_lob.compare(lob1,lob2)= 0,则它们是相同的.
If dbms_lob.compare(lob1, lob2) = 0, they are identical.
以下是基于您的示例的示例查询:
Here's an example query based on your example:
Select key, glob_value
From source_table Left Join target_table
On source_table.key = target_table.key
Where target_table.glob_value is Null
Or dbms_lob.compare(source_table.glob_value, target_table.glob_value) <> 0
这篇关于如何在Oracle中比较两个CLOB值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文