LPAD and RPAD fails ?
Posted in 2004
Ph. Chantry — — source: Usenet: comp.databases.informix
Good morning/evening,
Using dbaccess 9.40, the LPAD and RPAD SQL funcion gives strange results:
SQL script:
create temp table f1(chr char(4), vch varchar(4))WITH NO LOG;
insert into f1 values("1","1");
select chr, lpad(chr,4,'0') lpad_c, rpad(chr,4,'0') rpad_c,
vch, lpad(vch,4,'0') lpad_v, rpad(vch,4,'0') rpad_v
from f1;
Result:
chr lpad_c rpad_c vch lpad_v rpad_v
1 1 1 1 0001 1000
The functions only work with VARCHAR columns ?
They also work with INTEGER columns, or constant strings.
Any idea ?
Thank you,
Philippe