Example of paging stored procedure in DB2 (1)

Source: Internet
Author: User

During the use of the DB2 database, the stored procedure is always a problem. This article will explain the paging stored procedure in the DB2 database for your reference and hope to enlighten you.

Create procedure kyjt. USP_A_FY (in ptblname varchar (1000), -- table name
In pshowname varchar (1000), -- the field name must be displayed.
In pfldname varchar (1000), -- field name (primary key of the primary table, which cannot be repeated)
In ppagesize integer, -- if the page size is 0, the first 10 million pieces of data are returned by default.
In ppageindex integer, -- page number
In pordertype integer, -- set the sorting type. If the value is not 0, the data is sorted by the primary key IN descending order)
In pstrwhere varchar (1000) -- Query condition (Note: Do not add WHERE)
)
MODIFIES SQL DATA
DETERMINISTIC
LANGUAGE SQL
BEGIN
/**//*----------------------------------------------------------------
* Copyright (C) 2006 laugh crazy
* All Rights Reserved.
*
* Process function description:
* Versatile generic paging query statement (DB2)
*
* Create an identifier: longping520@126.com (modification)
*


Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.