2

I am building an application that has a couple hundred select`s and I need to print in a report the query time.

I am using Oracle databases with Toad IDE.

Let`s say for example I have a "select * from names" and I would like to print the query execution time.

Thanks

I created a function in Java because I am generating the report with Java but it prints the execution that it calculates from Java not the exact database query execution time

I would like to print the query execution time

  • 1
    IIRC, run as a script, and put `set timing on` at the top of the script. – Boneist Jul 03 '19 at 07:43
  • See this [answers](https://stackoverflow.com/questions/3559189/oracle-query-execution-time) - Possible duplicate of this question – Popeye Jul 03 '19 at 08:18

1 Answers1

3

A simple option is to view "Query viewer" tab; it shows execution time for each statement you run.

If it is a script you run within TOAD, then you'll have to calculate it yourself by subtracting date before the statement from date after that statement. Those DATE values should be set to SYSDATE. Result is number of days so you'll have to recalculate it to display something smarter (hours, minutes, seconds).

Littlefoot
  • 131,892
  • 15
  • 35
  • 57