Fujitsu UDS/SQL V2.5 사용자 설명서

다운로드
페이지 324
Defining an item
Schema DDL
58
  
 U929-J-Z125-9-76
4.2.2
Defining a packed numeric item 
[level-number ]item-name TYPE IS FIXED REAL DECIMAL
                        [ integer-1[,integer-2]].
Packed items can contain numeric values only. They are exclusively used as computational 
items by the database programmer and cannot be printed without prior editing by a DML 
program. Packed items require less storage space and can be processed faster than 
unpacked items. 
level-number
 denotes whether the item is part of a repeating group:
If the item is not to be part of a repeating group, the specified level number should be the 
smallest level number in the whole record type.
This is especially important if the item is to be used as a key item. 
If the item is to be part of a repeating group, proceed as described on 
item-name
 specifies the name assigned by the user. 
integer-1
 and integer-2 are used to describe the value range of an item, where
integer-1
 indicates the number of storage locations the item contains, the maximum 
being 18. Each storage location can be filled with a decimal digit. 
Default value for integer-1: 18 
integer-2
 specifies the position of the decimal point. This has no effect on the number of 
storage locations, however. If integer-2 is positive, it denotes the number of digits to the 
right of the decimal point; if it is negative, it signals to UDS/SQL how many zeros it is to 
append to the item contents when performing calculations.
It follows that if integer-2 is m, specification of integer-2 means a multiplication of the item 
contents by 10
-m
Default value for integer-2: 0 
If at least one of the following assertions applies to an unpacked numeric item, the item 
cannot be accessed using SQL, nor can any new records of the record type involved be 
inserted: 
number of bytes of storage > 15 
scale factor < 0 
scale factor > number of bytes of storage
A positive scale factor specifies the number of digits to the right of the decimal point, while 
a negative scale factor specifies how many zeroes UDS/SQL must append to the item 
contents when performing calculations.