Re: Problem with data block "where" clause

From: Andy Hardy <>
Date: Wed, 26 May 1999 11:05:50 +0100
Message-ID: <>

In article <>, Andy Hardy <> writes
>In article <>, Dean Peterson
><> writes
>>I have a form that has two blocks, a control block and a data block. The
>>purpose of the control block is to provide the user with two fields, one
>>to enter the name of a column in the data block table, and the other to
>>enter a column value so a search on the combination can be performed.
>>The where clause in the data block reads as follows:
>So you have a database table called ctrl_block and your data block uses
>this for its base table?
>Probably not. The WHERE clause needs to be a valid SQL statement for the
>base table of your block - all that happens when Forms does a query on
>the block is that it sticks a 'WHERE' and the where clause onto the end
>of the SQL statement.
>It sounds like you need to use the set_block_property to change the
>where clause when you've set the control block to the values you like.
>Something like:
> set_block_property('data_block', default_where,
>:ctrl_block.field_name||' like %'||:ctrl_block.field_value||'%');

Just noticed that the above is missing lots of quote-quotes to ensure that the SQL is valid... something like

blah ||' like ''%'||:ctrl_block.field_value||'%'' ')

Andy Hardy. PGP key available on request
Received on Wed May 26 1999 - 12:05:50 CEST

Original text of this message