Re: Problem with data block "where" clause

From: Andy Hardy <aph_at_ahardy.demon.co.uk>
Date: Wed, 26 May 1999 11:05:50 +0100
Message-ID: <bNTExHA+d8S3EwXK_at_ahardy.demon.co.uk>


In article <pvcCxGAcGnS3EwDn_at_ahardy.demon.co.uk>, Andy Hardy <aph_at_ahardy.demon.co.uk> writes
>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||'%');
>
>

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