Subject RE: [firebird-support] Custom search string
Author Tim Gahnström
> -----Original Message-----
> Quite frankly - I dont understand how you could frame your response in
> such a manner given that my entire question was and is related to stored
> procedures.

I am quite sure the question was not intentionally framed in any particular way it was more likely a quick answer to a misunderstood question.

But the sorry fact is, I think, that there is no good solution to your problem. I am no expert or even good at FB but I had a similar problem a week ago and found no good solutions to it

I don't know the specifics of the EXECUTE STATEMENT but I know it can solve your problem (in a, no doubt, ugly way).

The other solution is to use a huge if statement which may or may not be even uglier and a nightmare to maintain.

You might also be able to solve your problem with the coalesce function which lets you return a specific thin in case of the parameter is null

Where colA like coalesce(:param,'%')

Will for instance match anything while :param is null

Coalesce is a special case of the CASE statement which might also help you but what I think you are really looking for is full blown case logic where parts of the statement can be included depending on some input. This is unfortunately not present in FB.

Tim