SQL/MX 3.1 Database and Application Migration Guide (H06.23+, J06.12+)
Considerations for upgrading to SQL/MX Release
3.1
HP NonStop SQL/MX Release 3.1 Database and Application Migration Guide—663853-001
2-4
Conversions from numeric to char or varchar
Example 1
>>create table tnumeric (a numeric (18,6));
--- SQL operation complete.
>>
>>insert into tnumeric values (123456789012.345678);
--- 1 row(s) inserted.
>>
>>select cast(a * 10 as char(18)) from tnumeric;
*** ERROR[8402] A string overflow occurred during the
evaluation of a character expression. Conversion of Source
Type:DECIMAL SIGNED(REC_DECIMAL_LSE) Source
Value:0x2B0001020304050607080900010203040506070800 to Target
Type:CHAR(REC_BYTE_F_ASCII).
--- 0 row(s) selected.
>>
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
Value:0x2B0001020304050607080900010203040506070800 to Target
Type:CHAR(REC_BYTE_F_ASCII).
--- 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










