Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Creating a "Most Popular Pages" List

595001Sep 19 2007 — edited Sep 19 2007
The setup's like this:

* Each page that is tracked has a SQL statement that increments the number in an "occurances" column in a table specifically made for this purpose.

* The db_occurances table has three columns - page number, page name, and occurances.

* The main page of the application has a PL/SQL anon block region that is supposed to display the two most visited pages in list form.

* The main page contains four hidden items that each have a SQL query; they have a value equal to something like this:

select pagename from (select rownum r,pagename from db_occurances order by occurances desc) where r = 1;

* The main anon block takes the values of these four items and uses them to build the list of popular pages.

--

The part that doesn't work is the SQL query in the four items. Instead of ordering the rows by occurances in descending order as they're meant to, they're ordering the rows as they appear in an unordered query.

Doing a SQL query "SELECT pagename FROM db_occurances ORDER BY occurances DESC" in the SQL Workshop returns the correct order.

Anyone have any idea what could be the problem?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2007
Added on Sep 19 2007
9 comments
812 views