Back to results
US 8,478,733 B2Granted
Substitute function in projection list
AssigneeInternational Business Machines Corporation
InventorVaibhav S. Dantale
Life of this patent
Estimating the term…
Abstract
Techniques are disclosed for retrieving database data records using a request having a substitute clause. The substitute clause replaces a value stored in a predefined column with a new value while selecting the values of the plurality of columns in a projection list. In one embodiment, the database request may utilize a pre-defined syntax for a SELECT statement that supports a substitute clause having a form of: substitute(<col name>, <expression>).
Claims15
A computer-implemented method, comprising:
- receiving a database request having a projection operation for all of a plurality of columns in one or more tables, wherein the projection operation comprises a SELECT statement having a column list that includes having (i) a shorthand that specifies all of the plurality of columns and (ii) a substitute clause that specifies a column from the plurality of columns and an expression, wherein the shorthand comprises a wildcard that expands to specify all of the plurality of columns, the shorthand being less than a plurality of column references to the plurality of columns;
- responsive to the request, retrieving one or more data records having the plurality of columns including the specified column;
- evaluating the specified expression to generate an expression result corresponding to a respective data record of the one or more data records;
- and
- generating, by operation of one or more computer processors, a result set comprised of the one of more data records having the plurality of columns, such that, for the respective data record, a value for the specified column is replaced with the corresponding expression result, wherein a number of columns in the result set is the same as the number of the plurality of columns in the one or more tables and specified by the shorthand.
2 more elements
A computer program product, comprising:
- a non-transitory computer-readable storage medium having computer-readable program code embodied therewith, the computer-readable program code comprising:
- computer-readable program code configured to receive a database request having a projection operation for all of a plurality of columns in one or more tables, wherein the projection operation comprises a SELECT statement having a column list having that includes (i) a shorthand that specifies all of the plurality of columns and (ii) a substitute clause that specifies a column from the plurality of columns and an expression, wherein the shorthand comprises a wildcard that expands to specify all of the plurality of columns, the shorthand being less than a plurality of column references to the plurality of columns;
- computer-readable program code configured to, responsive to the request, retrieve one or more data records having the plurality of columns including the specified column;
- computer-readable program code configured to evaluate the specified expression to generate an expression result corresponding to a respective data record of the one or more data records;
- and
- computer-readable program code configured to, generate a result set comprised of the one of more data records having the plurality of columns, such that, for the respective data record, a value for the specified column is replaced with the corresponding expression result, wherein a number of columns in the result set is the same as the number of the plurality of columns in the one or more tables and specified by the shorthand.
3 more elements
A system, comprising:
- one or more computer processors;
- a memory containing a program, which when executed by the one or more computer processors is configured to perform an operation comprising:
- receiving a database request having a projection operation for all of a plurality of columns in one or more tables, wherein the projection operation comprises a SELECT statement having a column list that includes having (i) a shorthand that specifies all of the plurality of columns and (ii) a substitute clause that specifies a column from the plurality of columns and an expression, wherein the shorthand comprises a wildcard that expands to specify all of the plurality of columns, the shorthand being less than a plurality of column references to the plurality of columns;
- responsive to the request, retrieving one or more data records having the plurality of columns including the specified column;
- evaluating the specified expression to generate an expression result corresponding to a respective data record of the one or more data records;
- and
- generating a result set comprised of the one of more data records having the plurality of columns, such that, for the respective data record, a value for the specified column is replaced with the corresponding expression result, wherein a number of columns in the result set is the same as the number of the plurality of columns in the one or more tables and specified by the shorthand.
4 more elements
Dependencies are inferred from the claim text.