I create a table with a field for decimal data type. When I cast it to VARCHAR and check the length it seems as if an extra space has been added to the field. Anyone experienced this before, and how to solve for it?
create multiset table XYZ ( EVT_ID DECIMAL(5) ) ;
insert into XYZ ( EVT_ID) Sel 301 AS EVT_ID;
sel * from ud505.XYZ
sel LENGTH (trim(CAST(EVT_ID AS VARCHAR(50)))) as evt_id_len ,SUBSTRING(trim(CAST(EVT_ID AS VARCHAR(50))),0,3) AS evt_id_2 from XYZ;