Home » Fusion Middleware & Colab Suite » Weblogic & Application Server » limiting number of displayed rows.
limiting number of displayed rows. [message #76332] Mon, 04 March 2002 13:14 Go to next message
Sabrina
Messages: 76
Registered: February 2002
Member
I am using PSP pages:
I am developing a website where I have to query a Oracle database which contain about 3 million records. The number of records returned will normally be around 200 - 300. I want to display them on a web page with only 25 records each time. the users can then click Next to see the next 25 records. How would I best achive this.

Right now my code looks like:

CREATE OR REPLACE PACKAGE PayerIDFourButtonPackage AS
PROCEDURE PayerIDFourButtonTest
(v_begin IN NUMBER DEFAULT 1, v_end IN NUMBER DEFAULT 20);
END PayerIDFourButtonPackage;
/

CREATE OR REPLACE PACKAGE BODY PayerIDFourButtonPackage AS
PROCEDURE PayerIDFourButtonTest
(v_begin IN NUMBER DEFAULT 1, v_end IN NUMBER DEFAULT 20) AS
cursor cuSrv(v_begin IN NUMBER, v_end IN NUMBER) is
select servicestate,AmericanTerritory
from
(select rownum rnum, servicestate,AmericanTerritory
from tbl_servicestateterritoryref)
where
rnum between v_begin and v_end
and rownum <= (v_end - v_begin + 1)
order by servicestate;
BEGIN
htp.htmlOpen;
htp.headOpen;
htp.title( 'Four Button Test Page');
htp.headClose;
htp.p(' FORM TAG REMOVED = method="post" ');
htp.p('action="PayerIDFourButtonPackage.PayerIDFourButtonTest?v_begin="||v_begin || "& v_end=" || v_end');
htp.bodyOpen;
htp.tableOpen(calign => 'center', cattributes => 'width="100", border = "1"' );
htp.p('
');
htp.p(' - Service State - ');
htp.p(' - Desc - ');
htp.p('
');
for crSrv in cusrv(v_begin,v_end) loop
htp.tableRowOpen;
htp.tableData(crsrv.servicestate);
htp.tableData(crsrv.AmericanTerritory);
htp.tableRowClose;
end loop;
htp.tableClose;
htp.paragraph;
htp.p(htmlform.buttonsStart);
htp.p(htmlform.button('First', 'PayerIDFourButtonPackage.PayerIDFourButtonTest'));
htp.p(htmlform.button('Prev', 'PayerIDFourButtonPackage.PayerIDFourButtonTest'));
htp.p(htmlform.button('Next', 'PayerIDFourButtonPackage.PayerIDFourButtonTest?v_begin=20&v_end=40'));
htp.p(htmlform.button('Last', 'PayerIDFourButtonPackage.PayerIDFourButtonTest'));
htp.p(htmlform.buttonsEnd);
htp.bodyClose;
htp.htmlClose;
END PayerIDFourButtonTest;
END PayerIDFourButtonPackage;
Re: limiting number of displayed rows. [message #76341 is a reply to message #76332] Thu, 14 March 2002 23:54 Go to previous message
shastry
Messages: 3
Registered: January 2002
Junior Member
You can use cursors to fetch limited records with %ROWCOUNT option

Shastry
Previous Topic: Import/export Adobe Files
Next Topic: How do I get red of INTERNAL ?
Goto Forum:
  


Current Time: Sat Feb 24 15:38:07 CST 2024