After looking at a number of paging stored procedures, it was found to be for SQL Server, without Oracle, so I wanted to write a stored procedure about Oracle because the database I used was Oracle.
--------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------
The idea of the Oracle paging stored procedure is the same as that of SQL Server, but I have made some changes here because of the differences in Oracle's syntax and rules, Oracle paging
The stored procedure looks a little different. Laughed, laughed!
Returning a recordset in Oracle's stored procedure requires a cursor variable, and Oracle cannot return a recordset directly as SQL Server can.
Due to the idea of generating complex SQL statements in. NET, the problem of generating SQL statements is not considered in the stored procedure.
--------------------------------------------------------------------------------------------------------------- -----------------------
The following are the paging stored procedures implemented in Oracle.
Create or Replace package dotnet is
--Author:good_hy
--CREATED:2004-12-13 13:30:30
--Purpose:
TYPE Type_cur is REF CURSOR; --Define a cursor variable to return the recordset
PROCEDURE dotnetpagination (pindex in number,--Paging index
Psql in VARCHAR2--SQL statements that produce a dataset
Psize in number--page size
Pcount out number--returns total paging
V_cur out Type_cur--Returns the current page data record
);
Procedure Dotnetpagerecordscount (
Psqlcount in VARCHAR2,--SQL statement that produces a dataset Prcount out number--returns total records
);
End Dotnot;
--------------------------------------------------------------------------------------------------------------- -----------------------------------------------------
Create or Replace package body dotnet is
--***************************************************************************************
PROCEDURE Dotnetpagination (
Pindex in number,
Psql in Varchar2,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.