title: Directly refer to a public synonym in Oracle
body: <p>I know this is backwards, but say we have an inflexible tool or situation which always creates SELECT statements in the form </p>
  
  <pre><code>SELECT * FROM ${SCHEMA}.${TABLE};
  </code></pre>
  
  <p>Now say we have a public synonym for table called MY_TABLE but no actual MY_TABLE in the current schema. That is our user is USER but the synonym for MY_TABLE points to OTHER_USER.MY_TABLE.</p>
  
  <p>Note that this works fine as expected: select * from MY_TABLE UNION ALL select * from OTHER_USER.MY_TABLE;</p>
  
  <p>I'd like to do something like</p>
  
  <pre><code>SELECT * FROM SYNONYMS.${TABLE};
  </code></pre>
  
  <p>Is there anything we can place in ${SCHEMA} that will force Oracle to find and resolve the synonym? I've tried the following <em>literal</em> SQL statements to try to refer to the synonym directly and they don't work.</p>
  
  <pre><code>select count(*) from USER.MY_TABLE; 
  
  select count(*) from CURRENT_SCHEMA.MY_TABLE;
  
  select count(*) from .MY_TABLE;
  
  select count(*) from %.MY_TABLE;
  </code></pre>
  
  <p>Note that we must refer to the synonym because we change the synonym frequently to help with production installs therefore I can't just place OTHER_USER in $SCHEMA because it could be OTHER_USER or OTHER_USER2 or OTHER_USER3 for reasons outside of the control of my code.</p>