Browse Prior Art Database

Multi Query Cursor

IP.com Disclosure Number: IPCOM000013940D
Original Publication Date: 2001-Apr-22
Included in the Prior Art Database: 2003-Jun-19
Document File: 2 page(s) / 64K

Publishing Venue

IBM

Abstract

For the purposes of this publication, a query is a select statement against a relational database to retrieve a result set consisting of zero or more rows of data. A cursor is a positional pointer into the result set. A primary key is a unique identifier for a row of data within a table.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 83% of the total text.

Page 1 of 2

Multi Query Cursor

For the purposes of this publication, a query is a select statement against a relational database to retrieve a result set consisting of zero or more rows of data. A cursor is a positional pointer into the result set. A primary key is a unique identifier for a row of data within a table.

A multi query uses one or more queries to return one logical result set. A single cursor is used to position into each of the result sets sequentially. As one result set is completed, the next query is executed and the cursor continues to the first row of the next physical result set. The logical result set, which is what the user sees, can be implemented as an ordered set or an ordered collection based on the ordering of the individual queries.

ADVANTAGES

Supports queries that are too complex to code or run with a single dynamic SQL statement

Provides better performance for most complex queries

Minimizes the effort to develop and test complex queries

Supports priority based queries

Supports heterogeneous result sets

Provides for late execution and instantiation of result sets so that some queries may not need to execute if a cursor is not run to the end

Is pluggable into any cursor API. Some additional API's are needed to construct the multi-query.

This will work with almost any architecture design including n-tier and client-server.

1

Page 2 of 2

Union queries

Table 1 .. Table n

Table 1

Table n

Union Query Union SQL C1Result Result

Query1 SQL 1 C1Result 1 Res...