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: random function help

Re: random function help

From: DECo <karpurapus_at_detroitedison.com>
Date: 1997/08/20
Message-ID: <01bcada6$7b84ac00$185909a2@karpurapus.deco.com>#1/1

There is no built in Random number generator in Oracle. So you might want to create a store function which will return a number. This number can be based on the current date/time (sysdate) and some other variables and then convert them into a number by using the ascii function.

For example
Create or Replace Function RandNum return number is

    tempStr varchar2(20);
Begin

    tempStr:= to_char(sysdate,'ss');
    return ascii(tempstr);
end;

You can use a random function of your own

Hope this works for you

Sreeni



Sreeni Karpurapu
DBA
Miracle Software Systems,
23800 West 10 Mile Road
Ste 190A
Southfield, MI 48034

Lan Tran <lantran_at_ventera.com> wrote in article <01bcad61$8fccae00$0a37a8c0_at_tweety>...
> hello,
>
> i am looking for a function that will return a random number to me.
 please
> reply to my e-mail as well as this newgroup. thank you very much.
>
> Lan
> lantran_at_ventera.com
>
>
Received on Wed Aug 20 1997 - 00:00:00 CDT

Original text of this message

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