Re: Oracle to PGSQL -- need help

From: Masaru Sugawara <rk73(at)sea(dot)plala(dot)or(dot)jp>
To: Randall Barber <rdb55(at)email(dot)byu(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Oracle to PGSQL -- need help
Date: 2002-07-26 13:54:23
Message-ID: 20020726223411.C8F4.RK73@sea.plala.or.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 25 Jul 2002 15:17:08 -0600
Randall Barber <rdb55(at)email(dot)byu(dot)edu> wrote:

> I greatly appreciate your time and help--I have not yet tried to implement
> what you gave me, but here is some additional explanation:
>
> ABS(MOD(DBMS_RANDOM.RANDOM, 100))
>
> This generates a random number between between +/- 2^32. I use the MOD to
> keep the number with a range (0-100) and an ABS to make it positive
> regardless. The idea is to pick a random row out of information that shares
> a common value. In your example, you list everything in the table, but
> without much changing I think I can make it so that the result brings back a
> single row instead of multiple. Just needs a where clause in one of the
> SELECTs :).

Thank you for your explanation. I were roughly able to figure out the whole
process you thought. But there are some columns I don't know; actually
their names don't appear in either of this mail and prior mail. Could you tell
me the answer to the following questions ?

1. Does "a common value" mean one of the values that Q column has?
2. Does "a range (0-100)" mean the fact that the range is always 0 to 100 ?
Doesn't the range depend on the number of the rows that share a selected
value ?

>> Given an insert request, I want the trigger to find out which # is used on
>> the left, and then randomly select one of the resultant rows and insert the
>> randomly picked row's PKEY value along with the original insertion info.
>> into a third table.

3. What table is "a request" inserted into ?
4. What column is "PKEY" created on ?

>> Q, JOBID
>> --------
>> 1,2
>> 1,5
>> 1,200
>> 1,4356
>> 1,483

4. Is this a second table ?

Regards,
Masaru Sugawara

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tourtounis Sotiris 2002-07-26 14:10:46 Index scan ???
Previous Message strange 2002-07-26 13:28:58 Re: little shell script