title: Using CURSOR to fetch multiple table names from another table
body: <p>I've created one table "Meta_Data_Table_Names" where I inserted   forty eight  table names   in the MetaTableName column.  And there is another column to provide Row count with corresponding table name. </p>
  
  <p>I wanted to fetch the table name from “Meta_Data_Table_Names” and execute SELECT Query sequentially through Loop for validation purpose.
  Whenever, I execute from TOAD , It’s throwing an error:
  Table or view does not exist.</p>
  
  <p>Do we need to make a place holder for 'Meta_name' which can be scanned? Or any particular syntax to read the value during Query?</p>
  
  <pre><code>DECLARE
      CURSOR c1 IS SELECT MetaTableName FROM Meta_Data_Table_Names;
      CURSOR c2 IS SELECT ROW_COUNT FROM Meta_Data_Table_Names;
      Meta_name  Meta_Data_Table_Names.MetaTableName%TYPE;
      Count_num Meta_Data_Table_Names.ROW_COUNT%TYPE;
  BEGIN
      OPEN c1;
      OPEN c2;
      FOR i IN 1..48 LOOP
          FETCH c1 INTO Meta_name;
          FETCH c2 INTO Count_num;
          IF (Count_num &gt; 2000)
             THEN
                 SELECT * FROM  Meta_Name  X 
                 MINUS  
                 SELECT * from   ASFNCWK07.Meta_Name@NCDV.US.ORACLE.COM Y
                 UNION ALL
                 SELECT * FROM  ASFNCWK07.Meta_Name@NCDV.US.ORACLE.COM  Y 
                 MINUS  
                 SELECT  * FROM  Meta_Name  X;    
             ELSE    
                 DBMS_OUTPUT.PUT_LINE ('No Validation is required');
          END IF;
      END LOOP;
  END;
  </code></pre>