开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜