Re: Oracle Forms Question

From: Jo Coutuer <100450.331_at_CompuServe.COM>
Date: 1995/05/02
Message-ID: <3o5oj5$oni$1_at_mhade.production.compuserve.com>#1/1


Hi,

Try this line procedure:

  1. Create a button but put it in a different block, preferably a block that has no TABLE associated to it (a control block). If you do put it in the same block, you will get as many buttons as you have records in that block, so you have to put it in a tableless block with only one record.
  2. Associate a WHEN-BUTTON-PUSHED trigger to that button
  3. In that trigger, use the SET_BLOCK_PROPERTY command (use the reference guide for exact syntax) and set the DEFAULT_WHERE property to something like 'WHERE SALARY=SELECT MAX(SALARY) FROM EMPLOYEE_TABLE'. Then code the EXECUTE_QUERY built in to automatically issue the query. In this way you will get all the employees that have the highest salary (in case of equal highest salaries) without having to perform any additional actions.
  4. Should you already have a DEFAULT WHERE property for that block, make sure to capture that one first with the GE_BLOCK_PROPERY function before changing it with the SET_BLOCK_PROPERTY. By capturing it first, you can return it to its original state after the query has been issued.
-- 
Jo Coutuer
Received on Tue May 02 1995 - 00:00:00 CEST

Original text of this message