Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Newb Question - ZIP Code city look up...

564484Sep 17 2007 — edited Sep 17 2007

Hi,

I have a "Text Field (always submits page when Enter pressed)" field P2_ZIP_CODE which is based upon my database table field "EMPLOYEES"."ZIP_CODE".

I've created an "After Submit" branch that redirects the page back to itself before processing so that when the Enter button is pressed - the page just refreshes.

I would like to have it such that if someone changes/enters a value in that field, that I display the CITY and STATE that the ZIP_CODE represents in a Text field called: P2_CITY_AND_STATE.

I've defined the source of P2_CITY_AND_STATE like so:

SELECT cities.city_name || ', ' || states.state_name
FROM zip_codes zc
   , cities
   , states
WHERE zc.city_id = cities.city_id
  AND zc.state_id = states.state_id
  AND zc.zip_code = :P2_ZIP_CODE

The P2_ZIP_CODE and P2_CITY_AND_STATE field shows the proper city and state when browsing through fields - but when I submit the page following the Enter button being pressed in the P2_ZIP_CODE field - it just re-fetches the OLD value of ZIP_CODE and the City and State values from the row in the database table.

Can someone tell this Newb what I'm doing wrong? I just want to have a user be able to type a zip code, hit enter, and then show the city and state that the zip belongs to.

Thanks!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2007
Added on Sep 17 2007
5 comments
722 views