Finding a column value inside a user-supplied string
By Rudy Limeback, SQL Consultant, r937.com
SearchOracle.com
Most examples of LIKE use a table column as the value to search in, with the string supplied by the user as the value to search for. For example, say you have a products table, and the user enters the string 'ultra':
SELECT id
, description
FROM products
WHERE description LIKE '%ultra%'
This query finds all products where 'ultra' (the value to search for) is located somewhere within the product description (the value to search in).
In your case, you want to have the string supplied by the user as the value to search in, with the cat_num column as the value to search for. All you need to do is reverse the normal sequence, and append the necessary wildcards, like this:
SELECT cat_num
FROM yourtable
WHERE 'This piece of wire has 902S type ...'
LIKE '%' || cat_num || '%'
Here, the double pipes are the standard SQL concatenation operator.
Oracle White Papers: Fusion Middleware