Issuing a query of the CONTAINS function searches for text in columns found in tables.
SELECT AUTHOR,TITLE
FROM DB2EXT.TEXTTAB
WHERE CONTAINS(COMMENT, '"book"') = 1
In this example, you search for the term book in the column COMMENT.
Searching for "" is not supported. Using two consecutive quotation marks in a search term will result in a syntax error message. Also, a query syntax error occurs if a newline character is used within the search string.
SELECT AUTHOR,TITLE
FROM db2ext.texttab
WHERE CONTAINS(COMMENT, '"book"') = 1 AND PRICE < 20