title: Searching multiple columns query does not appear to function
body: <p>I found this query on an old post but there is no activity.(I am not strong in SQL)</p>
  <p>I am trying to search all column for a specific value.</p>
  <p>I am using the latest Oracle SQL Developer and executing the SQL using a SQL Worksheet.</p>
  <p>Here is the SQL:</p>
  <pre><code>DECLARE
    match_count integer;
    v_search_string varchar2(4000) := 'Male';
  BEGIN 
    FOR t IN (SELECT owner,
                     table_name,
                     column_name
                FROM all_tab_columns
               WHERE data_type in ('CHAR', 'VARCHAR2', 'NCHAR', 'NVARCHAR2',
                                   'CLOB', 'NCLOB') AND table_name = 'PersonG')
             
    LOOP  
      BEGIN
        EXECUTE IMMEDIATE   
          'SELECT COUNT(*) FROM '||t.owner || '.' || t.table_name||
          ' WHERE '||t.column_name||' = :1'  
           INTO match_count 
          USING v_search_string;
        IF match_count &gt; 0 THEN
          dbms_output.put_line( t.owner || '.' || t.table_name ||' '||t.column_name||' '||match_count );
        END IF;
      EXCEPTION
        WHEN others THEN
          dbms_output.put_line( 'Error encountered trying to read ' ||
                                t.column_name || ' from ' ||
                                t.owner || '.' || t.table_name );
      END;
    END LOOP;
  END;
  /
  </code></pre>
  <p>When I execute it, I immediatly get the Script Output window with just <code>PL/SQL procedure successfully completed.</code> I know the string is in the table.</p>
  <p>If I remove <code>AND table_name = 'PersonG'</code> the script takes so long to run the connection times out(probably our VPN that I have no control over) so I tried to restrict to a table name. I also tried  <code>AND owner = 'user'</code> instead of table but it was the same.</p>
  <p>If I execute:</p>
  <pre><code>                SELECT owner,
                     table_name,
                     column_name
                FROM all_tab_columns
               WHERE data_type in ('CHAR', 'VARCHAR2', 'NCHAR', 'NVARCHAR2',
                                   'CLOB', 'NCLOB') AND table_name = 'PersonG'
  </code></pre>
  <p>it gives me the columns from that table.</p>
  <p>Am I doing something wrong?</p>
  <p>Also, is there a way to change it to LIKE instead of matching?</p>
  <p>Thanks.</p>