I\'m trying to find a specific string in an entire Oracle database.
I\'ve followed the example in another topic on here (Search All Fields In All Tables For A Specific
You can concatenate the bind variable with the wildcard %
characters:
EXECUTE IMMEDIATE
'SELECT COUNT(*) FROM ' || t.owner || '.' || t.table_name ||
' WHERE '||t.column_name||' LIKE ''%'' || :1 || ''%'''
INTO match_count
USING 'ALERT';
Note that the single quotes have to be escaped by doubling them up.
Change it to
EXECUTE IMMEDIATE
'SELECT COUNT(*) FROM ' || t.owner || '.' || t.table_name ||
' WHERE '||t.column_name||' like :1'
INTO match_count
USING '%ALERT%';