Back to results
US 2013/0086019 A1Published application
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>).
Claims24
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 column list having (i) a shorthand that specifies the plurality of columns and (ii) a substitute clause that specifies a column from the plurality of columns and an expression;
- 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
(canceled)
A computer program product, comprising:
- a 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 column list having (i) a shorthand that specifies the plurality of columns and (ii) a substitute clause that specifies a column from the plurality of columns and an expression;
- 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
(canceled)
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 column list having (i) a shorthand that specifies the plurality of columns and (ii) a substitute clause that specifies a column from the plurality of columns and an expression;
- 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
(canceled)
Dependencies are inferred from the claim text.