Home » Developer & Programmer » Forms » Forms 6i : unable to query the Employee(EMP) Details, Based on Department Name(DEPT.DNAME), (forms 6i, xp)
Forms 6i : unable to query the Employee(EMP) Details, Based on Department Name(DEPT.DNAME), [message #321783] Wed, 21 May 2008 05:32 Go to next message
kumarc
Messages: 5
Registered: May 2008
Junior Member
Hi All,
i am giving the Input as Dept Name(DNAME) in Department Table(DEPT). Based on the Input DNAME it needs to query the employee details and also display the Department Name for every record.

I had write procedure (TEST_EMP_DEPT) in attached file. Please check and suggest me where i went wrong in the code.

PS:- I am createing a deptname in DEPTNO field. changed the properties.

Any help is appreciated.

Thanks in advance.
Re: Forms 6i : unable to query the Employee(EMP) Details, Based on Department Name(DEPT.DNAME), [message #321796 is a reply to message #321783] Wed, 21 May 2008 06:22 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why wouldn't you (instead of a complicated scenario) use a simple, default master-detail relationship?

Follow Data Block Wizard; create DEPT as a master, EMP as a detail. Join these blocks on DEPTNO column. Forms will do the rest.

Compile and run the form.

In other words, perhaps you should first learn how to make it work, and then - if necessary - make it fancy.
Re: Forms 6i : unable to query the Employee(EMP) Details, Based on Department Name(DEPT.DNAME), [message #321828 is a reply to message #321796] Wed, 21 May 2008 07:34 Go to previous messageGo to next message
kumarc
Messages: 5
Registered: May 2008
Junior Member
yes littlefoot, Master-Detail Relation is very simple, But my scenario is difeerent below.

Issue:
1) The Query field is Department Name(DNAME)- when query the Department Name, internally it needs to check the dept no then the Department Number(DEPT NO) Details wanted to display in the EMP Details Block.
2) Also wants to display the Department Name(DNAME) instead of displaying the Department Number(DEPTNO) in EMP Detail block.

Note: The EMP BLock is a Records Based Format(5 records need to show at the same time with scroll bar).

The above 2 issues should be cover. so i used that scenario.

if create a Master - Detail Relation how could we do those?

Also i have some other query fields like employee no(empno) also there to display the same EMP Detail Block Details.

Please check the scenario and know me how to do that.

Thanks,
kumar
Re: Forms 6i : unable to query the Employee(EMP) Details, Based on Department Name(DEPT.DNAME), [message #321930 is a reply to message #321828] Wed, 21 May 2008 19:44 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Use the master-detail facility supplied by Forms as recommended by Littlefoot. Then use 'post-query' to populate non-database fields with the 'expansion' of the stored information. That is, 'emp' stores the 'dept_no', but you can have a non-database field 'emp_blk.ndb_dept_name' which you populate in the 'post-query' trigger on the 'emp' blocks via a 'select' statement based on 'dept' using ':emp_blk.dept_no'.

Look at the 'master-detail' tutorial pointed to from the Oracle Forms website. Also search this forum for 'master detail'.

David
Re: Forms 6i : unable to query the Employee(EMP) Details, Based on Department Name(DEPT.DNAME), [message #322277 is a reply to message #321930] Fri, 23 May 2008 00:01 Go to previous message
kumarc
Messages: 5
Registered: May 2008
Junior Member
Thanks a lot Matt
The issue is resolved with your solution and also another way of procedure written for the same.

Regards,
Kumar
Previous Topic: suggestions required
Next Topic: Can't create file with CLIENT_TEXT_IO.FOPEN
Goto Forum:
  


Current Time: Sat Dec 10 20:17:13 CST 2016

Total time taken to generate the page: 0.09558 seconds