Oracle
 sql >> Database >  >> RDS >> Oracle

Oracle SQL anno illegale

Puoi provare questo? per generare una data casuale

 declare
 a date;
 begin                                                                                                                  
  --  for i in 1..5                                                                                                          
  --  loop                                                                                                                   
a  := trunc(sysdate + dbms_random.value(0,366)) ;                                   
 --end loop;
 dbms_output.put_line(a);  
end;                                                                                                                   
/                                                                                                                   

ESECUZIONE:

SQL> @seq.sql                                                                                                               
20-MAY-16                                                                                                                   

PL/SQL procedure successfully completed.                                                                                    

SQL> @seq.sql                                                                                                               
10-NOV-15                                                                                                                   

PL/SQL procedure successfully completed.                                                                                    

SQL> @seq.sql                                                                                                               
09-JUN-15                                                                                                                   

PL/SQL procedure successfully completed.