Hi Thang and Karina,
DIGITS is the simplest option when converting positive-only or unsigned SMALLINT or INTEGER values. But as noted, for signed or decimal numbers you would need to re-insert the sign and decimal place, which can be cumbersome.
For signed/decimal numbers, the CAST...AS CHAR (or VARCHAR) is the simplest solution. Here's an example using the sample tables supplied with Datacom...
SELECT CAST(YTD_WAGES AS VARCHAR(11)) YTD_WAGES,
CAST(0 - YTD_WAGES AS VARCHAR(11)) NEG_WAGES
FROM SYSUSR.PAYROLL;
Cheers,
Owen
------------------------------
Technical Consultant
Dixons Carphone
------------------------------
Original Message:
Sent: 08-07-2020 10:25 AM
From: Karina Pulinx
Subject: Datacom SQL: the function to convert any data type to String
Hi,
Maybe you can use DIGITS
Best regards,Karina.
------------------------------
Principal Support Engineer
Broadcom
Original Message:
Sent: 08-07-2020 10:08 AM
From: THANG TRAN
Subject: Datacom SQL: the function to convert any data type to String
Hello,
I am using Datacom SQL and cannot yet find a scalar function to convert any data type to String.
In other database, this function is often to_char() like in:
select to_char(salary) from employee
What is the similar function to to_char() in Datacom SQL?