I think there is a bug in LPAD() function.

Just try to run this query:
    SELECT LPAD(12, 3, '0');
        This will correctly return 012 as expected.

But when I run 
    SELECT LPAD(512, 3, '0');
        It doesn't return 512, instead it returns special characters.
       
With that situation I tried the following
    SELECT LPAD('512', 3, '0');
        And it worked as required. 

So, my conclusion will be that the type conversion will only take place when the 
number of characters to PAD is bigger than the length of the original string.


Thanks,
__________________________________
NZEYIMANA Emery Fabrice
NEFA Computing Services, Inc.
P.O. Box 5078 Kigali
Office Phone: +250-51 11 06
Office Fax: +250-50 15 19
Mobile: +250-08517768
Email: [EMAIL PROTECTED]
http://www.nefacomp.net/

Reply via email to