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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Challenge: algorithm to transform unique string into unique number

Re: Challenge: algorithm to transform unique string into unique number

From: Jochen Van den Bossche <jochen.vandenbossche_at_proximus.net>
Date: 27 Aug 2002 07:55:42 -0700
Message-ID: <2bbd972e.0208270655.2332dcc4@posting.google.com>


upuaut_at_yahoo.com (upuaut) wrote in message news:<c1a86e59.0208231013.7608106a_at_posting.google.com>...
> Group A (we) has a database with few tables that maintains
> demographics and survey responses of a list of users. A user is
> identified by their (type text) user_id . Each of course have their
> own unique one.
>
> The challenge: We (group A) need to feed out survey data into a nother
> database maintained by group B (them) that uses a number as a unique
> identifier for the user_id. Is there a way I can generate a *MAGICAL*
> unique number for every user from the user_id?
>
> Also, we should be able to get the user_id from the generated number.
>
> The login ID is varchar2(100)
> The number to be generated is Number(20)
>
> Any help/pointers is/are appreciated.
>
> thanks.

Quick&Dirty:
In a loop take the to_char(chr()) of each letter and append it to what you allready have. Then to_number(the_long_string) (may result in very big numbers though :-)

Is'n it better to maintain a translation table (id_num, id_str) in your (or the other) database? Received on Tue Aug 27 2002 - 09:55:42 CDT

Original text of this message

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