SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

Introduction
HP NonStop SQL/MX Reference Manual523725-004
1-27
Selecting or Changing Data
The start-ym and end-ym specify a range of logically contiguous fields:
YEAR
MONTH
Day-Time Interval
Specify a day-time duration:
INTERVAL start-dt [(digits)] [TO end-dt]
The start-dt and end-dt specify a range of logically contiguous fields:
DAY
HOUR
MINUTE
SECOND
FRACTION [(precision)]
The start-dt must precede the end-dt. The FRACTION field can include the
precision option only if the FRACTION field is the end-dt.
Selecting Any INTERVAL Column
You can select data from any SQL/MP INTERVAL columns with a start field of YEAR
through SECOND. All SQL/MP INTERVAL data types that have a start field of YEAR
through SECOND are directly compatible with their corresponding SQL/MX INTERVAL
data types.
If you attempt to select data from a FRACTION-only column, the value is returned as
the CHAR data type consisting of a string of '#' characters with the same display
length as the length of the column.
See Selecting INTERVAL Columns in SQL/MP Tables on page 6-32.
Inserting or Updating Any INTERVAL Column
NonStop SQL/MX supports inserting into or updating any columns with the INTERVAL
data type in SQL/MP tables except those consisting of FRACTION only. Use an
INTERVAL literal to insert into or update an INTERVAL column in the usual way. The
literal is specified:
[-]INTERVAL [-]{'year-month'|'day:time'} interval-qualifier
For the complete syntax of interval literals, see Interval Literals on page 6-69. See
Inserting Into or Updating Any SQL/MP INTERVAL Column on page 6-71.