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: Random Numbers

Re: Random Numbers

From: Derek D. Fielder <dfielder_at_usa.net>
Date: 1997/09/20
Message-ID: <3423FB3D.40B74A6B@usa.net>#1/1

Someone wrote:

> Derek,
>
> This is easier than it seems. Use the square of sysdate (which includes
> miliseconds) and normalize the lower end to your desired range.
>
> select sysdate * sysdate rand_var from dual;
>
> etc...
>
> Defining a callable PL/SQL function makes it all easier, but that is
> your decision. You can also use SQL*Plus variables.
>

Unfortunately I can't find a way to make this work. There are a couple of problems.
1. Sysdate is not a number and cannot be multiplied by itself. 2. If I convert it to a number it must first be converted to a char and there are no format masks that retain the milliseconds.

Do I not know how to use sysdate or is the square of the sysdate method invalid in Oracle?

===--->derek Received on Sat Sep 20 1997 - 00:00:00 CDT

Original text of this message

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