title: SQL Use a Variable as tablename
body: <p>i would like to set the Tablename as Variable </p>
  
  <p>Why: i go from a oracle db to a mysql db via db link and in the mysql db i have some table-names which includes the date- example: <code>data_20121126</code></p>
  
  <p>here's my statement :</p>
  
  <pre><code>DECLARE
     tbname   VARCHAR2 (200);
  BEGIN
     SELECT   ab.teste
       INTO   tbname
       FROM   (SELECT   '"data_'
                        || REPLACE (TO_CHAR (SYSDATE - 1, 'yyyy.mm.dd'),
                                    '.',
                                    '')
                        || '"@myDB'
                           AS teste
                 FROM   DUAL) ab;
     SELECT   * FROM tbname;
  END;
  </code></pre>
  
  <p>could anybody help me please?</p>
  
  <p>thanks in advance</p>