Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Triggers In Forms !!!! HELP !!!!!
Hi,
I don't know if I well understood your problem. If you want to display fields from other tables when you enter in the block and execute an execute_query then you must use the POST-QUERY trigger.
i.e.
Suppose the columns to display are ADDRESS from Table2 and the sum of
ORDERED from Table3
in WHEN-NEW-BLOCK-INSTANCE :
execute_query;
in POST-QUERY :
:My_Block.ADDRESS := select_address(:My_Block.Fist_Name);
:My_Block.TOTAL_ORDERED := select_tot_ord(:My_Block.First_Name);
the functions select_address and select_tot_ord could be as follow :
FUNCTION SELECT_ADDRESS (W_First_Name varchar2) return varchar2 IS
W_Value varchar2(50);
BEGIN
select address
into W_Value
from Table2
where first_name = W_First_Name;
return W_Value;
EXCEPTION
WHEN NO_DATA_FOUND THEN
return 'Address not found';
END;
FUNCTION SELECT_TOT_ORD (W_First_Name varchar2) return real IS W_Value
real;
BEGIN
select sum(ordered)
into W_Value
from Table3
where first_name = W_First_Name;
return W_Value;
END;
Hope this help...
Best regards
Patrick
EASYNITIN_at_NETSCAPE.NET (Nitin Tekchandani) wrote in message news:<e8140ffc.0201150336.33e0025a_at_posting.google.com>...
> Hi all,
> Have written a procedure which fetches a set of values from a
> table...and displays these values in the corresponding fields in the
> form
> am calling this procedure from WHEN-VALIDATE-ITEM trigger on a
> paricular item say First_Name .. Field First_Name has a LOV attatched
> to it....
> My problem is i want to display the values returned from the above
> said procedure as soon as i select a value in First_Name (from LOV)
>
> WHEN-VALIDATE-ITEM trigger is working fine but is fired only when i
> shift the focus from Field First_Name (on which it is being called) to
> any other field.
>
> i want to know that from which item-level trigger should i call the
> procedure
> such that the values in other fields are displayed as soon as i select
> First_name from its LOV
Received on Tue Jan 15 2002 - 11:22:22 CST