SQL/MX 2.3.x to SQL/MX 3.0 Database and Application Migration Guide (H06.22+, J06.11+)
Considerations for upgrading to SQL/MX Release
3.0
HP NonStop SQL/MX 2.3.x to SQL/MX 3.0 Database and Application Migration Guide—666210-002
2-9
Conversions from numeric to char or varchar
Example 2:
>>create table tnumeric (a numeric (18,6));
--- SQL operation complete.
>>
>>insert into tnumeric values (3.0),(123456789012.345678);
--- 2 row(s) inserted.
>>
>>select cast(a * 10 as char(18)) from tnumeric;
(EXPR)
------------------
30.000000
*** ERROR[8402] A string overflow occurred during the evaluation of a
character
expression. Conversion of Source Type:DECIMAL SIGNED(REC_DECIMAL_LSE) Source
Val
ue:0x2B0001020304050607080900010203040506070800 to Target
Type:CHAR(REC_BYTE_F_A
SCII).
--- 1 row(s) selected.
>>
>>select cast (max(a) as varchar(8)) from tnumeric;
*** ERROR[8402] A string overflow occurred during the evaluation of a
character
expression. Conversion of Source Type:LARGEINT(REC_BIN64_SIGNED) Source
Value:12
3456789012345678 to Target Type:VARCHAR(REC_BYTE_V_ASCII).
--- 0 row(s) selected.
>>
>>select cast(a * a as char(18)) from tnumeric;
(EXPR)
------------------
9.000000000000










