Dennis Cote wrote:
You could also do this:
SELECT x from y WHERE y.x LIKE '%' || ? || '%' ;

The || operator concatenates the % characters with your string. Now you don't need to massage the string in the calling code. Six of one, half dozen of the other.

Note, though, that as currently implemented (DRH has said it might change in the future) the concatenation will be performed for each row evaluated (and that particular query will guarantee a full-table scan) so doing it in the calling code would be a better idea if large tables are involved.

Reply via email to