NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
D-6
Data Types
PIC[TURE] [S]{ 9(integer) [ V[9(scale)] ] }
{ V9(scale) }
[ DISPLAY [ SIGN IS LEADING ] ]
[ COMP ]
specifies a numeric column. If you specify COMP, the column is binary and
equivalent to the data type NUMERIC. If you omit COMP, DISPLAY SIGN IS
LEADING is the default and the data type is equivalent to the data type DECIMAL.
The value of the number stored in the data item cannot exceed the number of 9s in
the PICTURE specification.
The S specifies a signed column. The sign is stored as the first bit of the leftmost
byte (digit). If you omit S, the column is unsigned.
A column with 10 or more digits must be signed.
The 9(integer) specifies integer number of digits. The value of integer must
be positive.
The V designates a decimal position. The 9(scale) designates the number of
positions to the right of the decimal point. The value of scale must be a positive
integer. If you omit V9(scale), the scale is 0. If you specify V9, the scale is 1.
Instead of integer or scale, you can specify multiple 9s, with each 9
representing one digit. For example, PIC 9V999 has a scale of 3.
The values stored in the column cannot exceed a value defined by the PICTURE
specification. The values of integer and scale determine the length of the column.
The sum of these values cannot exceed 18.
There is no default numeric column definition. You must specify either
9(integer) or V9(scale).
DATETIME [ start-field TO ] end-field
specifies a column that contains date, time, or date and time values.
start-field and end-field must be one of the following logically
contiguous fields: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND,
FRACTION. See DATETIME Data Type
on page D-14 for more information.
DATE
is equivalent to DATETIME YEAR TO DAY.
TIME
is equivalent to DATETIME HOUR TO SECOND.
TIMESTAMP
is equivalent to DATETIME YEAR TO FRACTION(6).