Re: Forms 4.5 'OPEN QUERIES'

From: Neville Sweet <sweet.neville.nj_at_bhp.com.au.no_junk_today_thanks>
Date: 1998/03/30
Message-ID: <01bd5b95$0a6221e0$45f11286_at_itwol-pc3963.itwol.bhp.com.au>#1/1


Hi Darren,

The 'value_error' exception is caused by the use of a > (greater than) symbol in a numeric field. You can enter symbols in Enter Query mode (query-by-example), but unfortunately this causes a problem if you explicitly use the item.
Indirection will solve this problem, because the Name_In function returns CHAR, eg.
IF Name_In('block.item-name') IS NULL

I am not aware of any easy way to check whether one of the queryable items is not null.

Rather than hard-code the items in your Pre-Query, you could do something re-usable like:

  nm_item          CHAR(30);
  nm_block_item    CHAR(40);
  id_item          ITEM;
  fl_found         BOOLEAN := FALSE;

BEGIN
 nm_item := Get_Block_Property(:System.Trigger_Block, FIRST_ITEM);  WHILE NOT fl_found
  AND nm_item IS NOT NULL
 LOOP
   nm_block_item := :System.Trigger_Block || '.' || nm_item;    id_item := Find_Item(nm_block_item);
   IF Get_Item_Property(id_item, QUERYABLE) = 'TRUE'     AND Name_In(nm_block_item) IS NOT NULL    THEN
     fl_found := TRUE;
   END IF;
   nm_item := Get_Item_Property(id_item, NEXTITEM);  END LOOP;

---


Darren Palmer <D.R.Palmer_at_btinternet.com> wrote in article
<6fhbuh$gt6$1_at_mendelevium.btinternet.com>...

> Dear all,
>
> I have a form with a single block with a number of items on it.
>
> I want to stop the user executing a query with all fields blank.
>
> The way I currently do it is to check that all the fields are NOT NULL
> in the pre query trigger. Although this works it strikes me as messy.
>
> Also for numeric fields if the user types >100 (to retrieve all records
> greater than 100)the pre query triggers raises a value error because the
> NOT NULL check expects the item to be a numeric and at that point it
> isn't. It is messy isn't it.
>
>
> Maybe there is a way to query the block's where clause just before it is
> submitted and if it is NULL then bounce it. I have tried this but the
> block's where clause is always NULL.
>
>
> Thanks in advance
>
> Darren
>
Received on Mon Mar 30 1998 - 00:00:00 CEST

Original text of this message