Home » Developer & Programmer » Forms » Forms 6i: Unable to query the EMP details. (Forms 6i, XP)
Forms 6i: Unable to query the EMP details. [message #323635] Thu, 29 May 2008 01:42 Go to next message
Messages: 8
Registered: May 2008
Location: Hyderabad
Junior Member

I am giving the input as Employee Number. Based on the input it needs to query the Employee details from the EMP table.

But I am getting all the records inspite of the criteria.
I want the particular record based on the input.

I am attaching the form here.
  • Attachment: emp_qur.fmb
    (Size: 48.00KB, Downloaded 140 times)
Re: Forms 6i: Unable to query the EMP details. [message #323640 is a reply to message #323635] Thu, 29 May 2008 02:07 Go to previous message
Messages: 20847
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why do you people make things as complicated as possible, instead of doing the opposite - keeping it as simple as possible?

Why wouldn't you simply create a block based on 'emp' table and execute query based on any criteria you want (including 'empno' column)? This is the default Forms behaviour, you don't have to code it.

However, if you chose to do it that way, why did you expect Forms to return a record that belongs to an employee whose 'empno' you enter into the 'empno' item? Where did you code that? What's exactly purpose of
	tempno number;
	select empno into tempno from emp where empno = :cb.emp_no;
You are selecting 'empno' into a variable and do nothing with it. Then you execute a query which, of course, returns all records. Why wouldn't it? You never restricted return data set!

If you insist on it, the solution is in setting the DEFAULT_WHERE block property, such as
set_block_property('emp', default_where, 'empno = ' || :cb.emp_no);

Once again: keep it simple.
Previous Topic: DDE in Forms10g
Next Topic: Reverse engineering an Oracle Form
Goto Forum:

Current Time: Thu Oct 20 16:39:32 CDT 2016

Total time taken to generate the page: 0.12146 seconds