Home » Developer & Programmer » Forms » LOV - select character value, but store numeric offset
LOV - select character value, but store numeric offset [message #140770] Wed, 05 October 2005 09:37 Go to next message
bdrufner
Messages: 42
Registered: August 2005
Location: Home of the Mardi Gras, N...
Member
Forms 9.0.4 (10g) and RDBMS 9.2

Probably a simply question, however I am new to Forms.

For sake of this discussion, let us use a subset of the EMP and DEPT tables that ship with the Oracle distribution.

EMP columns:
Deptno NUMERIC
Name VARCHAR2

DEPT columns:
Dname VARCHAR2
Deptno NUMERIC

My data block, EMP_BLOCK consist of the two columns in the EMP table. The Deptno value is not very useful to the user and they would like to see the actual dept value in Dname in the LOV.

How can I create a LOV that allows the user to select the Dname value from DEPT table based on the stored value of EMP_BLOCK.Deptno while still storing the numeric value of Deptno in the EMP table should the user change the value in Forms?

I would like to continue to store the numeric value of Deptno in the EMP table, just show the user the Dname value in DEPT table during query / insert / modify.

Easy enough in SQL (do a join), but I am sure that some trigger must be created in Forms, but can't seem to find the correct one.

Any help/sample code/ideas are appreciated. Thanks

Barry

[Updated on: Wed, 05 October 2005 09:40]

Report message to a moderator

Re: LOV - select character value, but store numeric offset [message #140863 is a reply to message #140770] Wed, 05 October 2005 23:42 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have a look at http://www.orafaq.com/forum/mv/msg/52878/140611/67467/#msg_140612. ID is ID but DEPARTMENT is NAME.

David
Re: LOV - select character value, but store numeric offset [message #140991 is a reply to message #140863] Thu, 06 October 2005 08:49 Go to previous message
bdrufner
Messages: 42
Registered: August 2005
Location: Home of the Mardi Gras, N...
Member
David,

Thank you very much for this solution.

To anyone who checks out this link, I can attest that David's advice worked very well.

Barry
Previous Topic: Restricting User Sessions
Next Topic: report id in forms9i & passing parameter to report9i (merged)
Goto Forum:
  


Current Time: Fri Sep 20 01:28:56 CDT 2024