Re: How to populate fields in Oracle Forms.

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Wed, 04 May 2005 07:54:12 -0700
Message-ID: <1115218206.567544_at_yasure>


Daku wrote:
> Hi,
> I am new to Oracle Forms so treat me as a layman. I created a form
> having the following fields SID, Emp_NO, Emp_Name, Emp_problem. After
> one enters the information the record is saved to a table called
> emp_prob. There is another table called emp_info. What I want to do is
> to have the Emp_No filed in the form as drop down and when a number is
> selected in that list it should automatically populate the Emp_Name
> field. Emp_NO and Emp_Name are stored in the table emp_info.
> I have looked far and beyond but to no avail. Is it even possible to
> do in Oracle. Please help.........

It appears from what you are asking that you need to learn about relational databases rather than Oracle Forms.

In a relational database you never populate duplicate fields in a child table with information from the parent with the sole exception being the foreign key that relates the records. So start by removing the duplicate columns from the child table.

In Forms this is done by creating a relationship in the Data Block Wizard. Create the block for the parent using the data block wizard. Then using the wizard select the child table being sure to include in selected fields the foreign key to the parent. Click "Next" and you will be looking at a page the has a button labeled "Create Relationship." Uncheck the Auto-join checkbox and then push the "Create Relationship" button. Select the default relation type. Select the parent table and press Ok. Under Detail Item and Master Item select the columns that create the join. Finish creating the child block. Forms takes care of everything else.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Wed May 04 2005 - 16:54:12 CEST

Original text of this message