Re: Forms 4.5 Pop-list question

From: Alan Kong <kkkong_at_ee.cuhk.hk>
Date: 1997/10/04
Message-ID: <615ep7$3rd_at_eng-ser1.erg.cuhk.edu.hk>#1/1


adam.warner_at_dalsemi.com wrote:
: Hi all,
 

: I am learning to use Oracle Forms 4.5W to develop some simple data-entry
: applications, but I am having trouble getting poplists to work like I
: want them to. Here's an example:
 

: I have two tables, a DEPARTMENT (DEPT) table and an EMPLOYEE (EMP) table.
: The EMP table has two columns, a numeric employee id and the employee's
: name. The DEPT table has two columns, the department name and the
: employee id of an employee assigned to the department. The employee id
: in the DEPTtable is foreign keyed to the EMP table.
 

: I have figured out how to make a form of the department table, where the
: department name is on one column and an employee name poplist populated
: at run-time from a query record group) comes up. The poplist displays
: the employees' names as the list item labels, and the list element values
: associated to the names are the employee ID's.
 

: The problem is this: when you use the POPULATE_LIST built-in to put the
: values from the record group query into the poplist's list item, it can
: only take values of type CHAR for both the list label values and the list
: element values. So, my numeric employee ID (the list element values)
: won't work. When querying, all rows in the DEPT table are "silently
: rejected" because a char "1" and a numeric 1 aren't equal.
 

: Does anyone have any ideas, or a work-around? I don't want to change my
: numeric id's to CHARs. Curiously, the pop-list does work if you just
: enter the numeric list values manually.

[Quoted] I have just done this recently. What I did was:

  1. Create a separate text item which was the poplist;
  2. This poplist did not belong to any database table;
  3. In the query for the poplist, I had "Select to_char(emp_id), name .......",this gave me the emp_id as char;
  4. Then I created a "When-validate-item" trigger to copy the to_number(emp_id) to the emp_id from the database

Hope this helps.

Regards
Alan

: Thanks,
: Adam Warner
: Computer Integrated Manufacturing
: Dallas Semiconductor
: <adam.warner_at_dalsemi.com>
 

: -------------------==== Posted via Deja News ====-----------------------
: http://www.dejanews.com/ Search, Read, Post to Usenet

--
Regards

Alan

*****************************************************************************
Alan, Kwok-Kee KONG                    | Email: kkkong_at_ee.cuhk.hk
Department of Electronic Engineering   |          alan_at_ee.cuhk.hk
The Chinese University of Hong Kong    | Tel:   +852 2609-8286 (voice)
Shatin, N.T.                           |        +852 2603-5558 (fax)
Hong Kong
*****************************************************************************
Received on Sat Oct 04 1997 - 00:00:00 CEST

Original text of this message