Subject | Re: SQLWhereItems |
---|---|
Author | George |
Post date | 2006-10-09T17:53:15Z |
--- In IBObjects@yahoogroups.com, "Alan McDonald" <alan@...> wrote:
I don't know if it helps but I got round it by using a TIBOQuery and
using the SQL property direct, ignoring the 'Where', 'Insert' etc.
SQL properties. That way I have full control. It seems to work fine,
no idea whether or not it is best practice though.
Regards
George Elton
>expression
> With regard to SQLWhereItems, The help file says:
> "Each unit of entries must aggregate to a syntactically valid SQL
> that evaluates to a Boolean True or False. It is possible to includeitems are
> parentheses to to provide for nesting of items. By default, all
> "ANDed" together, but if the OR operator is placed as an item onits own, it
> will be used instead of the default 'AND'."I think
>
> But if I do this
> IB_QJobsAccounts.SQLWhereItems.Add('(PROCESSED=''N'')');
> IB_QJobsAccounts.SQLWhereItems.Add('OR');
> IB_QJobsAccounts.SQLWhereItems.Add('(ABORTED=''Y'')');
>
> The SQL Monitor reveals this translation:
>
> WHERE (
> (
> (PROCESSED='N')
> )
> AND OR
> )
> AND (ABORTED='Y')
>
> and of course there is a syntax error here at "AND OR"
>
> Does anyone know what the trick is to make items get parsed the way
> the help file intends?Alan
>
> regards
> Alan McDonald
>
I don't know if it helps but I got round it by using a TIBOQuery and
using the SQL property direct, ignoring the 'Where', 'Insert' etc.
SQL properties. That way I have full control. It seems to work fine,
no idea whether or not it is best practice though.
Regards
George Elton