A bit crude.. but it ought to work:
SUBSTR('00000000' || CHAR(ARTICLE_NBR), LENGTH(RTRIM(CHAR(ARTICLE_NBR))),
9)
Cheers
Serge
"Chiranjeev Mukherjee "
<db2udbdba-ezmlmshield-x88653214.[Email address protected] wrote on
11/28/2005 06:21:31 AM:
> Hi gurus,
>
> My problem is as follows:
>
>
>
> I have a Numeric field ARTICLE_NBR of length 9.
>
> Some of the articles are of length less than 9.
>
> Suppose mys article no is : 123456
>
> In my output I need it as : 000123456.
>
>
>
> I need a query for this urgently.
>
> Please if anyone can help me........
>
>
>
>
>
>
>
> Regards
>
> Chiranjeev
>
> N
>
> 'We Stop playing not because we grow old,we grow old because we stop
> playing'
>
>
>
>
>
> ---------------------------------------------------------------------
> PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
> website: http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
DB2 & UDB email list listserv db2-l LazyDBA home page