Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Compute Date/ Time Scalar Functions at Compile Time When All Arguments are Constants

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

Publishing Venue

IBM

Related People

Boykin, JR: AUTHOR [+3]

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 date/time scalars are new functions which will be added to the OS/2* Database Manager ES 1.0. They include the following functions: char(), date(), day(), days(), hour(), microsecond(), minute(), month(), second(), time(), timestamp(), and year(). Each of the SQL date/time functions accepts one argument with the exception of the timestamp and the char scalar functions; they accept one or two arguments. The data type of the arguments and results vary from function to function.

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

Compute Date/ Time 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 date/time scalars are new functions which will be added to the
OS/2* Database Manager ES 1.0. They include the following functions:
char(), date(), day(), days(), hour(), microsecond(), minute(),
month(), second(), time(), timestamp(), and year(). Each of the SQL
date/time functions accepts one argument with the exception of the
timestamp and the char scalar functions; they accept one or two
arguments. The data type of the arguments and results vary from
function to function.

THE INVENTION

      The straightforward method of implementation for the SQL date/
time scalars 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 date/time 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.

      As an example, suppose a user wants to update a character
column that stores dates with the value '01/05/91'.  The user wants
the date to be stored in the JIS (Japanese Industrial Standard) date
format but is not familiar with that format.  The following SQL...