Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Hash a URL
With the correct version of Oracle, there is a published
hash function in package dbms_utility:
function dbms_utility.get_hash_value(
name varchar2, base number, hash_size number
The problem with hashing though is that two strings can hash to the same value, so you cannot really use a hash function for a unique key.
You could make the key
(hash-value, meaningless sequence)
to emulate an overflow mechanism
--
Jonathan Lewis
Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk
risholmr_at_j51.com wrote in message <7oul7r$5ks$1_at_nnrp1.deja.com>...
>I have a table which I would like to have a URL as a primary key. A
>URL of course can be very long. Is it possible to do a HASH type
>function to reduce the size and use that as a surrogate key. Anyone
>know of a good HASHing algorithm which would do the trick?
>
Received on Thu Aug 12 1999 - 09:32:09 CDT
![]() |
![]() |