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
madhuri_madhav
Messages: 8
Registered: May 2008
Location: Hyderabad
Junior Member
Hi,

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 143 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
Littlefoot
Messages: 20901
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
declare
	tempno number;
begin
	select empno into tempno from emp where empno = :cb.emp_no;
	execute_query;
end;
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);
execute_query;


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


Current Time: Sat Dec 10 15:02:45 CST 2016

Total time taken to generate the page: 0.04474 seconds