Virtualizing schema relations over a single database relation
AssigneeInternational Business Machines Corporation
InventorsHarish Deshmukh, Roger C. Raphael, Paul S. Taylor, Gabriel Valencia
Life of this patent
Estimating the term…
Abstract
According to one embodiment of the present invention, a system maps one or more virtual relations to a table of a relational database management system. The system generates a structured query language (SQL) statement for the table from a SQL statement for a virtual relation by applying the mapping to one or more elements of the SQL statement for the virtual relation. Embodiments of the present invention further include a method and computer program product for mapping virtual relations to a table in substantially the same manners described above.
Claims10
A system comprising:
- at least one processor;
- and
- at least one memory connected to the at least one processor, the at least one memory having instructions recorded therein which when executed by the at least one processor causes the at least one processor to perform:
- receiving a first structured query language (SQL) statement including a virtual relation;
- mapping the virtual relation to a base table of a relational database management system by:
- referencing a row of a first table of metadata corresponding to the virtual relation and having first information regarding the virtual relation,
- referencing at least one row of a second table of metadata, each of the at least one row of the second table of metadata including second information regarding a respective field of at least one field associated with the virtual relation, and
- referencing at least one row of the base table, each of the at least one row of the base table including an instance of a field value corresponding to the respective field of the at least one field associated with the virtual relation;
- generating a second SQL statement for the base table from the first SQL statement including the virtual relation by applying the mapping to one or more elements of the first SQL statement for the virtual relation;
- and
- applying the second SQL statement against real relations of the base table.
A computer program product comprising:
- a computer readable storage medium having computer readable program code embodied therewith for execution on a processing system, the computer readable program code comprising computer readable program code configured to perform:
- receiving a first structured query language (SQL) statement including a virtual relation;
- mapping the virtual relation to a base table of a relational database management system by:
- referencing a row of a first table of metadata corresponding to the virtual relation and having first information regarding the virtual relation,
- referencing at least one row of a second table of metadata, each of the at least one row of the second table of metadata including second information regarding to a respective field of at least one field associated with the virtual relation, and
- referencing at least one row of the base table, each of the at least one row of the base table including an instance of a field value corresponding to the respective field of the at least one field associated with the virtual relation;
- generating a second SQL statement for the base table from the first SQL statement including the virtual relation by applying the mapping to one or more elements of the first SQL statement for the virtual relation;
- and
- applying the second SQL statement against real relations of the base table.
Dependencies are inferred from the claim text.