Re: 'OR' condition in Query

From: Joe Brown <joebrownNO_SPAM_me_very_MUCH_at_leading.net>
Date: Thu, 01 Oct 1998 02:35:37 GMT
Message-ID: <3612e78e.111766912_at_news.leading.net>


Need to rephrase this question so that I can understand what you are asking.

Ed Jennings <jenningse_at_mindspring.com> wrote:

> I have a FORM (V5.0) that has multiple check boxes on it. The check
> boxes indicate a special condition of some sort (there are 6 different
> types). I have a need to run a query that selects all records where ANY
> of the check boxes are marked. How does FORMS handle this situation
> where you need to have records returned in the context of an OR
> condition?

If you want to be selective with the records returned based on which checkboxes are checked...

A Pre-Query Trigger that dynamically construct a where clause, may be the route you must go.

Your_Block.Pre-Query
DECLARE
  MyWhere VarChar2(255);
BEGIN
  If ControlBlock.CheckBox1 = 'X' Then
    MyWhere := 'field1 > 100';
  end if;
  if ControlBlock.CheckBox2 = 'X' Then
    If MyWhere <> '' then
      MyWhere := MyWhere || ' or field2 > 100';     else
      MyWhere := 'filed2 > 100';
    end if;
  end if;
  Set_Block_Property('Your_Block', DEFAULT_WHERE, MyWhereClause) END; HTH

--
joebrown
_at_leading.net
Received on Thu Oct 01 1998 - 04:35:37 CEST

Original text of this message