Forms5.0: How to prevent NO-Search-Criteria Query?

From: Sean Zhang <sean_at_cnfei.com>
Date: Wed, 09 Jun 1999 18:56:01 GMT
Message-ID: <5Ny73.4258$AO1.14233726_at_firenze.visi.net>



[Quoted] Hello, Everyone,

Our Developer 2000 version 2.0 is running on Windows 95 in a Client/Server configuration.

Question: If a user hits F7(enter-query) , then F8 (execute-query) without putting any search conditions on the form fields, the Query starts scanning [Quoted] the whole underlying tables, which may go forever for bigger tables. One way [Quoted] I thought can prevent this happening is to use a Pre-Query trigger detecting
if all fields are NULL, which will look like this:   if :Blk.field1 is null AND :blk.field2 is null AND...........:blk.field100 is null then

              message(' Query has no search condition, not allowed');
              raise  form_trigger_failure;
 end if;

Is there a better way to prevent something like this happening? I certainly think it's not
a good idea to list all field names in the code in order to detect if there is a search condition.
Any suggestions are greatly appreciated.

Sean Zhang
sean_at_cnfei.com Received on Wed Jun 09 1999 - 20:56:01 CEST

Original text of this message