USING Ext2 (CHAR(5)) INSERT INTO Test2 (Col2) VALUES (:Ext2 (DECIMAL(5), FORMAT '99999S'));
where Ext2 contains the strings ‘5678B’ and ‘9012L’.
Because Col2 does not have an attached FORMAT phrase, a simple SELECT, such as the following example, returns the results as seen immediately following.
SELECT Col2 FROM Test2;
Result:
Col2 ------- 56782. -90123.
A sign FORMAT phrase must be included in the SELECT statement in order to retrieve the values ‘5678B’ and ‘9012L’.
It is important to remember this rule when manipulating signed zoned decimal values, especially when using sophisticated facilities like subqueries.