|
|
Communicator 3000 MPE/iX Express 1 Based on Release 6.0: HP 3000 MPE/iX Computer Systems > Chapter 3 Technical Articles IMAGE/SQL Enhancement: P and Z Data Types |
|
by Dolly Hu Commercial System Division This IMAGE/SQL enhancement allows application programs using Image/SQL to enter unsigned data into TurboIMAGE/XL fields with P or Z data type. Prior to this enhancement, Zoned Decimal and Packed fields, when written from an application using IMAGE/SQL, were always populated with signed numbers. This created a problem for some application programs reading the data. For example, a COBOL program with a data item defined as Z4 in TURBO IMAGE, and 9(4) in the COBOL program (note the absence of the "S"), a number of 942 gets stored as "094B" (signed), and to the COBOL program, it is an invalid numeric. IMAGE/SQL SPLIT command and UPDATE TYPE command have been enhanced to allow SIGNED or UNSIGNED mapped type if the mapped type is DECIMAL. If UNSIGNED keyword is specified, then all positive values written from an application using IMAGE/SQL are unsigned. The default is SIGNED. If SIGNED/UNSIGNED key word is used with any mapped type other than DECIMAL, then "Syntax Error" is returned by IMAGE/SQL. Divides a large mapped column into two or more smaller columns. SYNTAX
EXAMPLE (i) SPLIT TABLE1.COLUMN5 INTO NEWCOLUMN1:I4:CHAR(8),& NEWCOLUMN2:X20,& NEWCOLUMN3:K3:DECIMAL(15,0) (ii) SPLIT TABLE2.COLUMN3 INTO NEWCOL1:I4:CHAR(8),& NEWCOL2:X20,& NEWCOL3:Z4:DECIMAL(4,0) UNSIGNED Updates data type mapping information for a specified TurboIMAGE/iX data type or a specified Mapped Column. SYNTAX U[PDATE] TYPE {SourceType IN { * }} { { MappedTable}} {IN MappedTable.MappedColumn } [TO NewMappedType [SIGNED ]] [UNSIGNED] EXAMPLES (i) UPDATE TYPE I4 IN COMPOSER (ii) UPDATE TYPE IN COMPOSER.BIRTHDATE TO CHAR(18) (iii) UPDATE TYPE IN TABLE1.UNSIGNEDZ4 TO DECIMAL(4,0) UNSIGNED |
|