Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / System Packages
 

Assign value from dbms_utility get_time to a number variable

SQL> SQL> set echo on SQL> SQL> create table t ( x int ); Table created. SQL> SQL> set serveroutput on SQL> SQL> declare   2          myStart number default dbms_utility.get_time;   3  begin   4          for i in 1 .. 1000   5          loop   6                  insert into t values ( 1 );   7          end loop;   8          commit;   9          dbms_output.put_line( dbms_utility.get_time-myStart || ' hsecs' );  10  end;  11  / 19 hsecs PL/SQL procedure successfully completed. SQL> SQL> drop table t; Table dropped. SQL>