Forms 6i: Unable to query the EMP details. [message #323635] |
Thu, 29 May 2008 01:42 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 983 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 Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 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 ofdeclare
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 asset_block_property('emp', default_where, 'empno = ' || :cb.emp_no);
execute_query;
Once again: keep it simple.
|
|
|