Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Random Numbers
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