Re: Problem with data block "where" clause

From: Andy Hardy <aph_at_ahardy.demon.co.uk>
Date: Tue, 25 May 1999 10:47:08 +0100
Message-ID: <pvcCxGAcGnS3EwDn_at_ahardy.demon.co.uk>


[Quoted] In article <374A2D94.6CB1B825_at_mail.direct.ca>, Dean Peterson <depeters_at_mail.direct.ca> 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:
>
>CTRL_BLOCK.FIELD_NAME like CTRL_BLOCK.FIELD_VALUE

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||'%');

-- 
Andy Hardy. PGP key available on request
===============================================================
Received on Tue May 25 1999 - 11:47:08 CEST

Original text of this message