Method, system and program product for rewriting view statements in structured query language (SQL) statements
First Claim
Patent Images
1. A computer implemented method for rewriting view statements in Structured Query Language (SQL) statements, the method comprising the steps of:
- a computer receiving a SQL statement with a full select portion having a reference to a view that contains a join operation;
in response to the full select portion having a reference to a view that contains a join operation, the computer moving the reference to the view out of the full select portion;
the computer resolving the view and the join operation separately from the SQL statement, and the computer creating in memory a temporary table with a result of the resolving; and
the computer inserting a reference to the temporary table, instead of the result of the resolving, in the full select portion.
5 Assignments
0 Petitions
Accused Products
Abstract
Under the present invention, when a SQL statement having a full select portion that references a view containing a join operation (e.g., a LOJ operation) is received, the reference to the view will be moved out of the full select portion. Once moved, the view and its join operation will be resolved separately from the SQL statement. The results of this resolution will be placed in a temporary table. A reference to the temporary table is then inserted in the full select portion, and the SQL statement is thereafter performed.
-
Citations
21 Claims
-
1. A computer implemented method for rewriting view statements in Structured Query Language (SQL) statements, the method comprising the steps of:
-
a computer receiving a SQL statement with a full select portion having a reference to a view that contains a join operation; in response to the full select portion having a reference to a view that contains a join operation, the computer moving the reference to the view out of the full select portion; the computer resolving the view and the join operation separately from the SQL statement, and the computer creating in memory a temporary table with a result of the resolving; and the computer inserting a reference to the temporary table, instead of the result of the resolving, in the full select portion. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A computer system for rewriting view statements in Structured Query Language (SQL) statements, the computer system comprising:
-
a central processing unit, a random access memory, and a computer readable storage media; first program instructions to receive a SQL statement with a full select portion having a reference to a view that contains a join operation; second program instructions, responsive to the full select portion having a reference to a view that contains a join operation, to move the reference to the view out of the full select portion; third program instructions to resolve the view and the join operation separately from the SQL statement, and create a temporary table with a result of the third program instructions resolving the view and the join operation separately from the SQL statement; and fourth program instructions to insert a reference to the temporary table, instead of the result of the third program instructions resolving the view and the join operation separately from the SQL statement, in the full select portion and thereafter perform the SQL statement; and
whereinthe first, second, third and fourth program instructions are stored on the computer readable storage media for execution by the central processing unit via the random access memory. - View Dependent Claims (8, 9, 10, 11, 12, 13)
-
-
14. A computer program product for rewriting view statements in Structured Query Language (SQL) statements, the computer program product comprising:
-
a computer readable storage medium; first program code for receiving a SQL statement with a full select portion having a reference to a view that contains a join operation; second program code, responsive to the full select portion having a reference to a view that contains a join operation, for moving the reference to the view out of the full select portion; third program code for resolving the view and the join operation separately from the SQL statement, and creating a temporary table with a result of the resolving; and fourth program code for inserting a reference to the temporary table, instead of the results of the third program code resolving the view and the join operation separately from the SQL statement, in the full select portion and thereafter performing the SQL statement; and
whereinthe first, second, third and fourth program code are stored on the computer readable storage medium for execution by a CPU. - View Dependent Claims (15, 16, 17, 18, 19, 20)
-
-
21. A computer implemented method for rewriting view statements in Structured Query Language (SQL) statements, the method comprising the steps of:
-
a computer receiving a SQL statement with a full select portion having a reference to a view that contains a join operation; the computer responding to the full select portion having a reference to a view that contains a join operation, by moving the reference to the view out of the full select portion; the computer resolving the view and the join operation separately from the SQL statement, and the computer creating in memory a temporary table with a result of the resolution; and the computer inserting a reference to the temporary table, instead of the results of the resolving step, in the full select portion and subsequently executing the SQL statement with a central processing unit.
-
Specification