Leading Zeros - Mailing list pgsql-novice

From
Subject Leading Zeros
Date
Msg-id 20050803212356.8972.qmail@web33309.mail.mud.yahoo.com
Whole thread Raw
In response to Vacuum with Views  ("John J. Urbaniak" <jjurban@attglobal.net>)
Responses Re: Leading Zeros  (Gordon Haverland <ghaverla@shaw.ca>)
List pgsql-novice
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.

when my user (that's me!) enters 00001 the begin box
and then enters 00003 in the end box, the following
gets entered in the pgsql...

00001
2
3

i'm using php to increment the serial number until it
gets to a value greater than the "end" value.  after
it increments, it loses the zeros.

i guess my options are...

1. have pgsql apply the leading zeros if they aren't
already there (if this is possible).
2. have php add the leading zeros prior to insertion.
3. enter the data with leading zeros stripped and then
use php to display the data with leading zeros.

does anyone have any insight into any of these issues?

tia...

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

pgsql-novice by date:

Previous
From:
Date:
Subject: Re: boolean or int2
Next
From: Gordon Haverland
Date:
Subject: Re: Leading Zeros