Subject CORRECTION Re: [firebird-support] formatting a number
Author Ali Gökçen
Hi,
I improved my solution a little more, whenever i find a spare
time.. :)

tmp = cast(12345 as varchar(10)) || 'I love Firebird even without
strlen! ;)';

while (not substring(tmp from 10 for 1) between '0' and '9')
tmp = '0' || tmp;
end

result = substring(tmp from 1 for 10); -- '0000012345'

nevertheless, the solution posted by Helen is more clear.
if you have too much records for this operation, like operator may
more slow i think..

Regars,

Ali