Re: Leading Zeros

From: Gnanavel S <s(dot)gnanavel(at)gmail(dot)com>
To: "operationsengineer1(at)yahoo(dot)com" <operationsengineer1(at)yahoo(dot)com>
Cc: ghaverla(at)shaw(dot)ca, pgsql-novice(at)postgresql(dot)org
Subject: Re: Leading Zeros
Date: 2005-08-04 04:55:04
Message-ID: eec3b03c0508032155315055a2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

You can try,
select to_char(generate_series(1,5),'00000');
to_char
---------
00001
00002
00003
00004
00005

On 8/4/05, operationsengineer1(at)yahoo(dot)com <operationsengineer1(at)yahoo(dot)com>
wrote:
>
> --- Gordon Haverland <ghaverla(at)shaw(dot)ca> wrote:
>
> > On Wednesday 03 August 2005 15:23,
> > operationsengineer1(at)yahoo(dot)com
> > wrote:
> > > can i use pgsql to force th einput of leading
> > zeros?
> > >
> > > i have an application that enters serial numbers
> > > within a range, eg, 00001 to 00003.
> >
> > Use a string type, but only allow certain
> > characters.
> >
> > Gord
>
> Gord,
>
> if i do that, though, i think i'm unable to increment
> the number string in php. the user inputs the
> beginning and ending s/n only. i use php to create
> and enter the other s/ns. can i still increment a
> number string using i++?
>
>
>
> __________________________________
> Yahoo! Mail
> Stay connected, organized, and protected. Take the tour:
> http://tour.mail.yahoo.com/mailtour.html
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

--
with regards,
S.Gnanavel
Satyam Computer Services Ltd.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Gnanavel S 2005-08-04 04:58:17 Re: string concatenation errors
Previous Message Dane Ensign 2005-08-04 04:41:31 string concatenation errors