Re: Leading Zeros - Mailing list pgsql-novice

From Gnanavel S
Subject Re: Leading Zeros
Date
Msg-id eec3b03c0508032155315055a2@mail.gmail.com
Whole thread Raw
In response to Re: Leading Zeros  (<operationsengineer1@yahoo.com>)
List 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@yahoo.com <operationsengineer1@yahoo.com > wrote:
--- Gordon Haverland <ghaverla@shaw.ca > wrote:

> On Wednesday 03 August 2005 15:23,
> operationsengineer1@yahoo.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.

pgsql-novice by date:

Previous
From: Dane Ensign
Date:
Subject: string concatenation errors
Next
From: Gnanavel S
Date:
Subject: Re: string concatenation errors