Leading Zeros

From: <operationsengineer1(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Leading Zeros
Date: 2005-08-03 21:23:56
Message-ID: 20050803212356.8972.qmail@web33309.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Gordon Haverland 2005-08-03 21:55:54 Re: Leading Zeros
Previous Message operationsengineer1 2005-08-03 21:12:49 Re: boolean or int2