Re: query urgent [message #78122] |
Sat, 19 January 2002 06:08 |
Shilpa
Messages: 59 Registered: November 2001
|
Member |
|
|
The following example might help you.
For example:
Deptview is created as follows:
create view deptview
as select deptno
from dept
where deptno in (10,20);
In the form there is a block called emp, before I execute the query I want to display only the rows in emp table that match with deptview. The common field between the table and view is deptno field.
So I write the following code in Key Execute query trigger at the form level.
SET_BLOCK_PROPERTY('EMP',DEFAULT_WHERE,'WHERE DEPTNO IN (SELECT DISTINCT DEPTNO FROM DEPTVIEW)');
GO_BLOCK('EMP');
EXECUTE_QUERY;
SET_BLOCK_PROPERTY('EMP',DEFAULT_WHERE,'');
When I click execute query only the rows in emp table whose deptno is 10 or 20 will be displayed.
Hope this helps!!!
|
|
|