title: Evaluate a varchar2 string into a condition for a SQL statement
body: <p>I'm trying to find which rows are missing from 1 database to another, I already have link to the both DBs and I already found out that I can't just join separate tables so what I'm trying right now is select the ID's from one table and paste them into the select statement for the other DB however I don't know how to parse a clob into a condition.</p>
  
  <p>let me explain further:</p>
  
  <p>I got this collection of varchar2's with all the ID's i need to check on the other DB, and I can iterate through that collection so I get a clob with form: 'id1','id2','id3'</p>
  
  <p>I want to run this query on the other DB</p>
  
  <pre><code>SELECT * FROM atable@db2 
  WHERE id NOT IN (clob_with_ids)
  </code></pre>
  
  <p>but I don't know how to tell PL/SQL to evaluate that clob as part of the statement.</p>
  
  <p>id field on atable@db2 is an integer and the varchar2 id's I got are from runnning a regex on a clob</p>
  
  <p>edit:</p>
  
  <p>I've been ask to add the example I was trying to run:</p>
  
  <pre><code>SELECT *   
    FROM myTable@db1   
    WHERE ( (creation_date BETWEEN to_date('14-JUN-2011 00:00:00','DD-MON-YYYY HH24:MI:SS') AND to_date('14-JUN-2011 23:59:59','DD-MON-YYYY HH24:MI:SS')) ) 
     AND acertain_id NOT IN (    SELECT to_number(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_SUBSTR(payload,'&lt;xmlTag&gt;([[:alnum:]]+)-'),'&lt;xmlTag&gt;',''),'-','')) as sameIDasOtherTable   
                                   FROM anotherTable@db2   
                                  WHERE condition1 ='bla'   
                                    AND condition2 ='blabla'   
                                    AND ( (creation_date BETWEEN to_date('14-JUN-2011 00:00:00','DD-MON-YYYY HH24:MI:SS') AND to_date('14-JUN-2011 23:59:59','DD-MON-YYYY HH24:MI:SS')) ) )   
    ORDER BY TO_CHAR(creation_date, 'MM/DD/YYYY') ASC;
  </code></pre>
  
  <p>I get error ORA-22992</p>
  
  <p>Any suggestiongs?</p>