Method, system, and program for using a fetch request to make data available to an application program
First Claim
Patent Images
1. A method for making data available to an application program, comprising:
- generating a result table including rows corresponding to a subset of rows in a base table having data in one or more columns that satisfy a query predicate clause, wherein the result table includes, for each row, a location identifier of the corresponding row in the base table;
maintaining a cursor row pointer that points to a current row in the result table;
receiving a fetch request from the application program to reposition the cursor row pointer to a target row in the result table that is different than the current row and return the data at the target row to the application program;
repositioning the cursor row pointer to point to the target row in the result table;
determining whether a delete flag for the target row indicates whether the corresponding row in the base table was deleted, wherein the target row in the result table is no longer available to return in response to the fetch request if the delete flag indicates that the corresponding row in the base table was deleted; and
returning a code to the application program in response to the fetch request indicating that the requested row in the result table is not available.
1 Assignment
0 Petitions
Accused Products
Abstract
Provided is a method, system, program, and data structures for making data available to an application program. A result table is generated including rows corresponding to a subset of rows in a base table having data in one or more columns that satisfy a query predicate clause. The result table includes, for each row, a location identifier of the corresponding row in the base table and a column for each column in a query select list. The result table is accessed to return requested data from the base table to the application program.
42 Citations
36 Claims
-
1. A method for making data available to an application program, comprising:
-
generating a result table including rows corresponding to a subset of rows in a base table having data in one or more columns that satisfy a query predicate clause, wherein the result table includes, for each row, a location identifier of the corresponding row in the base table;
maintaining a cursor row pointer that points to a current row in the result table;
receiving a fetch request from the application program to reposition the cursor row pointer to a target row in the result table that is different than the current row and return the data at the target row to the application program;
repositioning the cursor row pointer to point to the target row in the result table;
determining whether a delete flag for the target row indicates whether the corresponding row in the base table was deleted, wherein the target row in the result table is no longer available to return in response to the fetch request if the delete flag indicates that the corresponding row in the base table was deleted; and
returning a code to the application program in response to the fetch request indicating that the requested row in the result table is not available. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
using the location identifier for the target row to access the row in the base table corresponding to the target row;
updating the target row in the result table with the accessed row in the base table; and
returning the data from the accessed row in the base table to the application program in response to the fetch request.
-
-
3. The method of claim 1, wherein if the delete flag does not indicate that the corresponding row in the base table was deleted, then further performing:
-
using the location identifier for the target row to access the row in the base table corresponding to the target row;
determining whether the corresponding row in the base table was deleted from the base table, wherein the target row in the result table is no longer available to return in response to the fetch request if the corresponding row in the base table was deleted.
-
-
4. The method of claim 3, further comprising:
setting the delete flag to indicate that the corresponding row in the base table was deleted if the corresponding row in the base table is determined to have been deleted.
-
5. The method of claim 1, wherein if the delete flag does not indicate that the corresponding row in the base table was deleted, then further performing:
-
using the location identifier for the target row to access the row in the base table corresponding to the target row; and
determining whether the accessed row in the base table qualifies according to the query predicate clause, wherein the target row in the result table is no longer available to return in response to the fetch request if the corresponding row in the base table does not qualify according to the query predicate clause.
-
-
6. The method of claim 1, further comprising:
-
using the location identifier for the target row to access the row in the base table corresponding to the target row; and
determining whether the accessed row in the base table qualifies according to the query predicate clause, wherein the target row in the result table is no longer available to return in response to the fetch request if the corresponding row in the base table does not qualify according to the query predicate clause.
-
-
7. The method of claim 6, further comprising:
setting an update flag for the target row indicating that the corresponding row in the base table no longer qualifies according to the query predicate clause if the accessed row is determined to not qualify according to the query predicate clause due to an updating of the corresponding row in the base table.
-
8. The method of claim 6, wherein if the accessed row in the base table qualifies according to the query predicate clause, then further performing:
-
using the location identifier for the target row to access the row in the base table corresponding to the target row;
updating the target row in the result table with the accessed row in the base table; and
returning the data from the accessed row in the base table in response to the fetch request.
-
-
9. The method of claim 1, wherein the query select list is provided from a structured language query (SQL) SELECT statement and the query predicate clause is provided from an SQL WHERE statement.
-
10. The method of claim 1, wherein the result table comprises a database table.
-
11. The method of claim 1, wherein the location identifier identifies a page location including the record and a unique identifier of the record in the page.
-
12. The method of claim 1, wherein the fetch request specifies movement of the cursor row pointer one or more rows from the current result table row addressed by the cursor row pointer.
-
13. A system for making data available to an application program, comprising:
-
a computer readable medium;
a storage device;
a base table stored in the storage device;
means for generating a result table in the computer readable medium including rows corresponding to a subset of rows in a base table having data in one or more columns that satisfy a query predicate clause, wherein the result table includes, for each row, a location identifier of the corresponding row in the base table;
means for maintaining a cursor row pointer that points to a current row in the result table in the computer readable medium;
means for receiving a fetch request from the application program to reposition the cursor row pointer to a target row in the result table that is different than the current row and return the data at the target row to the application program;
means for repositioning the cursor row pointer to point to the target row in the result table;
means for determining whether a delete flag for the target row indicates whether the corresponding row in the base table was deleted, wherein the target row in the result table is no longer available to return in response to the fetch request if the delete flag indicates that the corresponding row in the base table was deleted; and
means for returning a code to the application program in response to the fetch request indicating that the requested row in the result table is not available. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
using the location identifier for the target row to access the row in the base table corresponding to the target row;
updating the target row in the result table with the accessed row in the base table; and
returning the data from the accessed row in the base table to the application program in response to the fetch request.
-
-
15. The system of claim 13, further comprising means for performing if the delete flag does not indicate that the corresponding row in the base table was deleted:
-
using the location identifier for the target row to access the row in the base table corresponding to the target row;
determining whether the corresponding row in the base table was deleted from the base table, wherein the target row in the result table is no longer available to return in response to the fetch request if the corresponding row in the base table was deleted.
-
-
16. The system of claim 15, further comprising:
means for setting the delete flag to indicate that the corresponding row in the base table was deleted if the corresponding row in the base table is determined to have been deleted.
-
17. The system of claim 13, further comprising means for performing if the delete flag does not indicate that the corresponding row in the base table was deleted:
-
using the location identifier for the target row to access the row in the base table corresponding to the target row; and
determining whether the accessed row in the base table qualifies according to the query predicate clause, wherein the target row in the result table is no longer available to return in response to the fetch request if the corresponding row in the base table does not qualify according to the query predicate clause.
-
-
18. The system of claim 13, further comprising:
-
means for using the location identifier for the target row to access the row in the base table corresponding to the target row; and
means for determining whether the accessed row in the base table qualifies according to the query predicate clause, wherein the target row in the result table is no longer available to return in response to the fetch request if the corresponding row in the base table does not qualify according to the query predicate clause.
-
-
19. The system of claim 18, further comprising:
means for setting an update flag for the target row indicating that the corresponding row in the base table no longer qualifies according to the query predicate clause if the accessed row is determined to not qualify according to the query predicate clause due to an updating of the corresponding row in the base table.
-
20. The system of claim 18, further comprising means for performing if the accessed row in the base table qualifies according to the query predicate clause:
-
using the location identifier for the target row to access the row in the base table corresponding to the target row;
updating the target row in the result table with the accessed row in the base table; and
returning the data from the accessed row in the base table in response to the fetch request.
-
-
21. The system of claim 13, wherein the query select list is provided from a structured language query (SQL) SELECT statement and the query predicate clause is provided from an SQL WHERE statement.
-
22. The system of claim 13, wherein the result table comprises a database table.
-
23. The system of claim 13, wherein the location identifier identifies a page location including the record and a unique identifier of the record in the page.
-
24. The system of claim 13, wherein the fetch request specifies movement of the cursor row pointer one or more rows from the current result table row addressed by the cursor row pointer.
-
25. An article of manufacture including code for making data available to an application program by:
-
generating a result table including rows corresponding to a subset of rows in a base table having data in one or more columns that satisfy a query predicate clause, wherein the result table includes, for each row, a location identifier of the corresponding row in the base table;
maintaining a cursor row pointer that points to a current row in the result table;
receiving a fetch request from the application program to reposition the cursor row pointer to a target row in the result table that is different than the current row and return the data at the target row to the application program;
repositioning the cursor row pointer to point to the target row in the result table;
determining whether a delete flag for the target row indicates whether the corresponding row in the base table was deleted, wherein the target row in the result table is no longer available to return in response to the fetch request if the delete flag indicates that the corresponding row in the base table was deleted; and
returning a code to the application program in response to the fetch request indicating that the requested row in the result table is not available. - View Dependent Claims (26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36)
using the location identifier for the target row to access the row in the base table corresponding to the target row;
updating the target row in the result table with the accessed row in the base table; and
returning the data from the accessed row in the base table to the application program in response to the fetch request.
-
-
27. The article of manufacture of claim 25, wherein if the delete flag does not indicate that the corresponding row in the base table was deleted, then further performing:
-
using the location identifier for the target row to access the row in the base table corresponding to the target row;
determining whether the corresponding row in the base table was deleted from the base table, wherein the target row in the result table is no longer available to return in response to the fetch request if the corresponding row in the base table was deleted.
-
-
28. The article of manufacture of claim 25, further comprising:
setting the delete flag to indicate that the corresponding row in the base table was deleted if the corresponding row in the base table is determined to have been deleted.
-
29. The article of manufacture of claim 25, wherein if the delete flag does not indicate that the corresponding row in the base table was deleted, then further performing:
-
using the location identifier for the target row to access the row in the base table corresponding to the target row; and
determining whether the accessed row in the base table qualifies according to the query predicate clause, wherein the target row in the result table is no longer available to return in response to the fetch request if the corresponding row in the base table does not qualify according to the query predicate clause.
-
-
30. The article of manufacture of claim 25, further comprising:
-
using the location identifier for the target row to access the row in the base table corresponding to the target row; and
determining whether the accessed row in the base table qualifies according to the query predicate clause, wherein the target row in the result table is no longer available to return in response to the fetch request if the corresponding row in the base table does not qualify according to the query predicate clause.
-
-
31. The article of manufacture of claim 30, further comprising:
setting an update flag for the target row indicating that the corresponding row in the base table no longer qualifies according to the query predicate clause if the accessed row is determined to not qualify according to the query predicate clause due to an updating of the corresponding row in the base table.
-
32. The article of manufacture of claim 30, wherein if the accessed row in the base table qualifies according to the query predicate clause, then further performing:
-
using the location identifier for the target row to access the row in the base table corresponding to the target row;
updating the target row in the result table with the accessed row in the base table; and
returning the data from the accessed row in the base table in response to the fetch request.
-
-
33. The article of manufacture of claim 25, wherein the query select list is provided from a structured language query (SQL) SELECT statement and the query predicate clause is provided from an SQL WHERE statement.
-
34. The article of manufacture of claim 25, wherein the result table comprises a database table.
-
35. The article of manufacture of claim 25, wherein the location identifier identifies a page location including the record and a unique identifier of the record in the page.
-
36. The article of manufacture of claim 25, wherein the fetch request specifies movement of the cursor row pointer one or more rows from the current result table row addressed by the cursor row pointer.
Specification