MattsBits
MattsBits

MattsBits

Count The Number Of Items On a Page In Oracle Portal  

by Matt Hawkins, 14/03/2011
Categories : Oracle

The following PLSQL code creates a database function that counts the number of items on a page in Oracle Portal. This function can then be called whenever an item count is required.

It creates the count by looking for items in the WWV_THINGS table where the parentid matches the id of the page you supply the function.


create or replace FUNCTION COUNT_PAGE_ITEMS(PPAGEID IN NUMBER) RETURN NUMBER AS

-- This function counts the number of items on a specified page.
-- It returns the count or zero.

intCount NUMBER;

BEGIN

SELECT COUNT(ID) INTO intCount FROM WWV_THINGS
WHERE CORNERID=PPAGEID;

RETURN intCount;

EXCEPTION WHEN OTHERS THEN

RETURN 0;

END COUNT_PAGE_ITEMS;

Author : Matt Hawkins  Last Edit By : Matt Hawkins
PHP Powered  MySQL Powered  Valid XHTML 1.0  Valid CSS  Firefox - Take Back The Web  EUKHost - Recommended Webhosting Solutions

MattHawkins CMS v3.0 - Copyright 2009-2022