Adding new filter to filter. Incorrect syntax near ')'.

Posts   
 
    
rparkins
User
Posts: 66
Joined: 04-May-2005
# Posted on: 16-Aug-2005 12:26:26   

Hi there,

I am getting exception Line 1: Incorrect syntax near ')'. I am using code generated form an old version and cannot at this stage upgrade.

Summary.

I am creating a filter and adding predicate expressions. Then if a search string is not null I am creating another filter with predicate expressions (these will be added as AddWithOr). This filter will be added to the original as an or AddWithAnd.

So the expression will be: select * from blah where a=1 AND (b like '%dfs%' OR c like '%dfs%');

Any hints on how to get rid of this or I may be doing something completely wrong rage

Many thanks

Richard

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 16-Aug-2005 12:58:42   

As you're using an old version I'd say you add an empty predicateexpression to another predicate expression. So before you add a predicate expression, try to test if it's empty by using its count property. This has been fixed some time ago.

Frans Bouma | Lead developer LLBLGen Pro