Search This Blog

Thursday, July 28, 2022

Measuring Elapsed Time to Run a SQL Query in PL/SQL

DECLARE 
   t1   timestamp;
   t2   timestamp;
BEGIN
   t1 := systimestamp; 

   FOR i IN 1..1000 LOOP
      Dbms_Output.Put_Line(TO_CHAR(i));
   END LOOP;
   
   t2 := systimestamp; 

   Dbms_Output.Put_Line('Start: ' || t1); 
   Dbms_Output.Put_Line('  End: ' || t2); 
   Dbms_Output.Put_Line('Elapsed Seconds: ' || TO_CHAR(t2 - t1, 'SSSS.FF'));
END;

Useful Links:

> Measuring Elapsed Time to Run a SQL Query in PL/SQL

No comments:

Post a Comment

Read file content from an Oracle Directory in PL/SQL/ in IFS

Read single file DECLARE file_handle_ UTL_FILE.FILE_TYPE; directory_name_ CONSTANT all_directories.directory_name%TYPE := '...

Popular Posts