Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

full text search - why is not contains evaluated?

923910Mar 14 2012 — edited Mar 15 2012
I have the following stored procedure:
CREATE PROCEDURE search (results OUT SYS_REFCURSOR, filter INT VARCHAR2)
IS
BEGIN
SELECT * FROM table WHERE filter IS NULL OR CONTAINS(column, filter, 1) > 0;
END

If the filter parameter is set to NULL, then why does Oracle still evaluate the CONTAINS?

How can I make it not evaluate CONTAINS when filter is null without using workarounds like CONTAINS(column, COALESCE(filter, '1=1'), 1) > 0;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 12 2012
Added on Mar 14 2012
4 comments
455 views