full text search - why is not contains evaluated?
923910Mar 14 2012 — edited Mar 15 2012I 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;