Note that there are some explanatory texts on larger screens.

plurals
  1. POBuilding a PL/SQL coverage report with DBMS Profiler
    text
    copied!<p>I am using <a href="http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_profil.htm">DBMS_PROFILER</a> for basic profiling of my PL/SQL packages. I am also using it to get code coverage statistics using the following query:</p> <pre><code>SELECT EXEC.unit_name unitname,ROUND (EXEC.cnt/total.cnt * 100, 1) Code_coverage FROM (SELECT u.unit_name, COUNT(1) cnt FROM plsql_profiler_data d, plsql_profiler_units u WHERE u.unit_number = d.unit_number GROUP BY u.unit_name) total, (SELECT u.unit_name, COUNT(1) cnt FROM plsql_profiler_data d, plsql_profiler_units u WHERE u.unit_number = d.unit_number AND d.total_occur &gt; 0 GROUP BY u.unit_name) EXEC WHERE EXEC.unit_name = total.unit_name </code></pre> <p>I clear the plsql_profiler_data,plsql_profiler_units,plsql_profiler_runs tables before each profiler runs so that I need not know the run id each time.</p> <p>This will give me Package wise information on the percentage of code that was covered during the profiling. Now I am trying to see if this can be built as a normal coverage report where I can know which line of code was covered and which one wasnt(say select lineOfCode, iscovered from...) so that I can built a report with html formatting to indicate if a line was covered or not.</p> <p>I am not too proficient in Oracle table structures on where the functions and procedures get saved etc. (Got the above query from a blog and modified slightly to remove run id's)</p> <p>Is this possible?</p> <p>If so how can I achieve this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload