Hi,
The last paramater of LPAD must be a string :
E.g:
select LPAD(1, 8, '0')

instead of

select LPAD(1, 8, 0)

Regards,

Gelu
_____________________________________________________
G.NET SOFTWARE COMPANY

Permanent e-mail address : [EMAIL PROTECTED]
                                          [EMAIL PROTECTED]
----- Original Message -----
From: "Alexander Dsugan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 02, 2002 11:06 AM
Subject: LPAD(), RPAD() problem


> Hello.
>
> I have a trouble.
>
> "select LPAD(1, 8, 0);" or
> "select LPAD(int_field, 8, 0) from TABLE;" produces "00000000" result.
>
> The function doesn't work as expected :(
> As I understand from the manul it should produce the same result as:
> "select CONCAT(REPEAT(0, 8 - LENGTH(ID)), ID) from TABLE;" -> "00000001",
> etc.
>
> (MySQL version() = 3.23.41-log, OS: Linux-Mandrake 8.0,
> 3.23.38-nt, OS: W2K SP 3)
>
>
> With best regards,
> Alexander.
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to