Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: function to create unique key for rows?

Re: function to create unique key for rows?

From: <markp7832_at_my-deja.com>
Date: Thu, 21 Oct 1999 14:16:46 GMT
Message-ID: <7un782$2gg$1@nnrp1.deja.com>


In article <380E4D68.D87A669C_at_yahoo.com>,   Shmooth <shmooth_at_yahoo.com> wrote:
> I have a large table (@1M rows) with several columns of VARCHAR2 data
> that I would like to be able to create unique indexable keys for to
> speed look-ups.
>
> For instance, now I do this:
> Select myData From myTable Where col1=this and col2=that and
col3=other
>
> and I'd like to be able to say this:
> Select myData From myTable Where
> new_indexed_column={some_value_i've_created}
>
> Does Oracle have a 'Hash' function of some type I can use to give each
> of these rows a unique indexable value?
>

Look up 'create sequence' in the SQL manual. A sequence generator will generate a series of unique numbers and they are intended to be used to create keys without running into lock conflicts.

insert ...... values (sequence_name.nextval,'my_data1',sysdate,....)



Mark D. Powell -- The only advice that counts is the advice that  you follow so follow your own advice --

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Oct 21 1999 - 09:16:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US