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

Enhance Parameter Marker Usage in SQL Date/ Time Arithmetic

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

Publishing Venue

IBM

Related People

Boykin, JR: AUTHOR [+3]

Abstract

Structured Query Language (SQL) includes date/time arithmetic operations used to manipulate date/time values. Date/time values can be incremented, decremented, and subtracted. These operations may involve decimal numbers called durations. A duration is a number representing an interval of time. One type of duration is called a labeled duration.

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

Enhance Parameter Marker Usage in SQL Date/ Time Arithmetic

      Structured Query Language (SQL) includes date/time
arithmetic operations used to manipulate date/time values. Date/time
values can be incremented, decremented, and subtracted.  These
operations may involve decimal numbers called durations.  A duration
is a number representing an interval of time.  One type of duration
is called a labeled duration.

      A labeled duration represents a specific unit of time as
expressed by a number (which can be the result of an expression)
followed by one of the seven duration keywords: YEARS, MONTHS, DAYS,
HOURS, MINUTES, SECONDS, or MICROSECONDS (the singular form of these
words is also acceptable).  The number specified is converted as if
it were assigned to a DECIMAL(15,0) number.  For example, in the
expression
      HIREDATE + 2 MONTHS + 14 DAYS
the labeled durations are 2 MONTHS and 14 DAYS.  Using static SQL,
the quantity of the labeled duration can be specified by a host
variable, as in
      HIREDATE + :numdays DAYS
where numdays is a variable in an application program.

      Although a dynamic SQL statement cannot include references to
host variables, it may include parameter markers.  These can be
replaced by the values of host variables when the prepared statement
is executed.  A parameter marker is a question mark (?) that is used
where a host variable could be used if the statement string were a
static SQL statement.  The data t...