Select cast( <fieldname> as sql_char) from… returns NULL
when fieldname is of type numeric.
create table test ( number numeric(2,0) ); insert into test values (0); insert into test values (1); insert into test values (2); insert into test values (3); select number, cast (number as sql_char ) from test;
Details? I did a few tests and everything works as expected. Maybe “fieldname” is already NULL? Have you checked CAST(IFNULL(fieldname, 0.0) as SQL_CHAR) or the like?