Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> c.d.o.misc -> Re: Getting long value

Re: Getting long value

From: DA Morgan <>
Date: Mon, 06 Nov 2006 10:02:20 -0800
Message-ID: <>

Eitan M wrote:

> What if I use LONG in DB, and it is almost imposible to change
> (standard program that create LONGS, and not LOBS, and lot of customers).
> Isn't any function to convert LONG to LOB (or to VARCHAR2 if I know it has 
> only characters) , so I can use it normally.
> Besides, I didn't understand what DBMS_CRYPTO is related to my question ?
> Thanks :)
> "Vladimir M. Zakharychev" <> wrote in message 

>> Eitan M wrote:
>>> Hello,
>>> I want to compare two LONG columns in a specific table (Oracle 8i).
>>> Maybe by the CRC code for the LONG column.
>>> Is there any function that convert the LONG column to CRC string ?
>>> Also I want to know which byte makes the difference.
>>> Is there any other solution for the above ?
>>> Thanks :)
>> The easiest solution is to take Oracle recommended approach: convert
>> all LONGs to LOBs in your db and never use LONGs again (see the docs
>> about the transition, it's covered in big detail there.) LOBs are much
>> easier to work with, there's DBMS_LOB.COMPARE function that can compare
>> two LOBs or equally sized parts thereof, and there's DBMS_CRYPTO.HASH
>> in 10g, which can MD5 or SHA-1 a LOB. Getting positions where the
>> difference starts and ends is not possible using OOTB functionality
>> afaik, but you can try to use a BDE implementation in Java for this if
>> you can find one.
>> Hth,
>> Vladimir M. Zakharychev
>> N-Networks, makers of Dynamic PSP(tm)

Please do not top post.

There is a demo for converting LONG to CLOB in Morgan's Library at

Convert now if you can. Oracle has deprecated the LONG data type.

Daniel A. Morgan
University of Washington
(replace x with u to respond)
Puget Sound Oracle Users Group
Received on Mon Nov 06 2006 - 12:02:20 CST

Original text of this message