Using data generator for timestamp

roni

Member
Hi,
I'm begeinner in pl/sql framework and i need help pls :o
How do i can use data generator tool to create values for my table with timestamp atribute?
Tahnks,
Aron
 
To generate random timestamp values, use a SQL expression with a random component. For example:

SQL(systimestamp - dbms_random.value * 10)

This generates a random timestamp value for the past 10 days.
 
This will not work as intended, because adding numerical data to TIMESTAMP data gives DATE result, not TIMESTAMP.
What should work is:
SQL(systimestamp - numtodsinterval(dbms_random.value * 10, 'DAY'))
 
Back
Top