Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Getting number of hits in a report (ApEx 3.0, Oracle DB 10g)
icon5.gif  Getting number of hits in a report [message #299595] Tue, 12 February 2008 10:24 Go to next message
Messages: 255
Registered: August 2007
Senior Member
Is it possible in Apex to easily get the number of hits from a report?

I have a page where the user should be able to search for persons, and their access rights to an account, by using either the name of the person or the account number. If it has no rights, the person will not be displayed. However, a different report should be shown if there were no hits in the first one, showing all the people who matched the person related search criteria, but didn't have any rights.

The tables are quite big, and because of that it would be easier to use the number of hits directly if I can get it. Otherwise it will take more programming to find the number of results from the query because it's a dynamic query, and I should reuse its code so that it will be quicker.
Re: Getting number of hits in a report [message #299606 is a reply to message #299595] Tue, 12 February 2008 11:41 Go to previous message
Messages: 11
Registered: August 2007
Location: Vienna, Austria
Junior Member
Hi Camilla,

there is no condition/variable available on the server side to check if a report region returned rows or not.

But you could write a package which contains a global variable and a function (it has to be one) which sets it. In your SQL Statement you could add a call to this function to set the global variable as indicator that a row has been returned. In your second region you could write a PL/SQL condition where you check this global variable if it is set or not.

Hope that gives you a direction
My APEX Blog: http://www.inside-oracle-apex.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://apexplugin.sourceforge.net/ *New!*
Previous Topic: plsql web toolkit
Next Topic: Handling multiple spaces in a column
Goto Forum:

Current Time: Sun Oct 23 07:32:04 CDT 2016

Total time taken to generate the page: 0.08974 seconds