Subject | Re: [Firebird-Java] PreparedStatement with LIKE ? extremly slow |
---|---|
Author | Roman Rokytskyy |
Post date | 2007-02-05T17:40:46Z |
> Of cause sometimes i use wildcards in this query.The only solution would be to use more complicated predicate, something
> That's the reason i use like instead of =.
like:
WHERE (1 = ? AND f_liefer_nr = ?) OR (2 = ? AND f_liefer_nr LIKE ?)
Note, you can't use "? = NULL" here, since Firebird won't be able to
determine type of the variable and you will get exception during prepare.
Roman
P.S. I did not test this statement, so you have to check how the
optimizer will behave.