Re: Zip Code Format Mask

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Thu, 22 May 2003 21:43:30 GMT
Message-ID: <MPG.1936e45b8a037bba989792_at_news.la.sbcglobal.net>


Tinkerist_at_hotmail.com said...
>
> "Daniel Morgan" <damorgan_at_exxesolutions.com> wrote in message
> news:3ECAB1F9.BC0A7C8_at_exxesolutions.com...
> > Aaron V wrote:
> >
> > > Hi,
> > >
> > > I'm using Forms 6i and I'm trying to set up a format mask to accept
> zip
> > > codes as 5 digit or 9 digit (99999-9999). I only want the first 5
> digits to
> > > be required. The last 4 are optional, but I want to have trailing zeros
> if
> > > omitted. I tried FM99999"-"0000 , which works fine if all 9 digits
> are
> > > entered, but with only five entered, it puts leading zeros, instead of
> > > trailing, and because of fill mode, allows less than the five digits
> > > required. Oh, does anyone know if zip codes ever have leading zero(s)?
> (I'd
> > > have to change the first 9 to a 0). Or if you've encountered this in the
> > > past and written a WHEN-VALIDATE-ITEM trigger I'd appreciate a look at
> it.
> > >
> > > Thanks in advance,
> > >
> > > AaronV
> >
> > Zip codes are not numbers they are strings in the same way that telephone
> and
> > social security numbers are strings not numbers. Only use numeric fields
> when
> > performing math and for surrogate keys.
> >
> > --
> > Daniel Morgan
> > http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
> > damorgan_at_x.washington.edu
> > (replace 'x' with a 'u' to reply)
> >
> >
> Yes, I agree the field for zip code should be stored as a character
> string, but only in the back-end,
> the database. I was under the impression the front end handled most of the
> data cleansing, and unless I'm
> mistaken there are no zip codes that contain alphabetic characters.
>
> I figured this was probably a common data input, so someone had
> addressed this issue already, so why
> re-invent the wheel. I'd rather work on my other wheels that are slightly
> more out of round...or learn from
> the perspective of other solutions.
>
> Thanks Again,
>
> AaronV
>
Well, in that case, you might want to check out the wheel for Oregon State University's BA372 course (Advanced Oracle Forms) at:

http://www2.bus.orst.edu/classes/BA372/FormBuilder/MTForm_S02.htm

It's an example taken from their textbook that shows one way (best way?) to validate zip codes ... have a table of legal zip codes that you can put in an LOV. You can get a CSV file of zip codes from the post office. Especially check out their "dependent" LOV, which lists only legal zip codes for a given supplier.

Wouldn't it be nice if they put their entire Forms class on the web?

I don't think they intended to open up their file system to the world, but if you cutoff the above URL at FormBuilder, you get a directory listing of files on their web server. Perhaps some kind soul will contact them to let them know about this.

BTW, I found this by searching Google for: oracle forms "zip code"

-- 
/Karsten
DBA > retired > DBA
Received on Thu May 22 2003 - 23:43:30 CEST

Original text of this message