Browse Prior Art Database

Compute Translate Scalar Functions at Compile Time When All Arguments are Constants

IP.com Disclosure Number: IPCOM000121716D
Original Publication Date: 1991-Sep-01
Included in the Prior Art Database: 2005-Apr-03
Document File: 2 page(s) / 63K

Publishing Venue

IBM

Related People

Boykin, JR: AUTHOR [+2]

Abstract

BACKGROUND An SQL scalar function is a function that produces a value from one or more scalar arguments and is expressed in a functional form. The SQL TRANSLATE scalar is a new function which will be added to the OS/2* Database Manager ES 1.0. The TRANSLATE function returns a value in which one or more characters in a string expression have been translated into other characters. THE INVENTION

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 58% of the total text.

Compute Translate Scalar Functions at Compile Time When All Arguments
are Constants

      BACKGROUND
An SQL scalar function is a function that produces a value from one
or more scalar arguments and is expressed in a functional form. The
SQL TRANSLATE scalar is a new function which will be added to the
OS/2* Database Manager ES 1.0. The TRANSLATE function returns a value
in which one or more characters in a string expression have been
translated into other characters.
THE INVENTION

      The straightforward method of implementation for the SQL
TRANSLATE scalar function is to completely execute the scalar at
run-time of an SQL statement. However, this entails computation of
the scalar on a per-row basis of the SQL answer set. Using this
invention, whenever the argument(s) of a SQL TRANSLATE scalar
function are constants, the Database Manager will compute the result
of the scalar function at compile time.  If there are any errors
during computation, they will be logged at compile time.

      The following example illustrates a scenario that would benefit
from this invention:  An application that queries a table for the
last name and phone numbers of all employess whose last name matches
a last name specified by the user. The names are stored in the table
in upper case only.  Using the TRANSLATE scalar function, the
application does not have to worry about NLS-dependent case mapping.
The application could simply build a dynamic select statement
searching on the...