PL/SQL procedure random timestamp
how i can generate a random timestamp and put it into 开发者_运维百科a var?
Thanks,
Tommaso
I found this solution
start_date + dbms_random.value(0,86400*(end_date-start_time)+1)/86400
at
http://www.orafaq.com/forum/t/122604/2/
not real sure why but something along the lines of the following pseudocode:
find a random number in a sufficiently large range, and either add or subtract that to SYSDATE.
we have random number generater in oracle...and this random number can be used to add in sysdate to get random dates..or time stamp.
精彩评论