Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: random function help
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
![]() |
![]() |