title: ORACLE synonym table describe constraints
body: <p>I would like to see the constraints defined in a synonym of a table. </p>
  
  <p>When a type </p>
  
  <p><code>SQL&gt; DESCRIBE table_name;</code></p>
  
  <p>It shows me only the number of each column, the not null flag and the size. How can I know all the constraints for each column? How can I know also if the synonyms are either public or private? </p>
  
  <p>Thanks,
  Alvaro.</p>
  
  <hr>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>With @Aramillo helps and adapting it to my needs, I figure out how to do it. I want to see the Constraints defined for a table but not according to the USER. There are two options, with <a href="http://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_1037.htm" rel="nofollow">ALL_CONSTRAINTS</a> and <a href="http://docs.oracle.com/cd/B14117_01/server.101/b10755/statviews_1035.htm" rel="nofollow">ALL_CONS_COLUMNS</a>.</p>
  
  <p><code>ALL_CONSTRAINTS</code> has not the column COLUMN_NAME in order to know the column's name which the constraints is set to. <code>[ALL_CONS_COLUMNS]</code> has.</p>
  
  <p>Query:</p>
  
  <p><code>SELECT * FROM all_cons_columns WHERE table_name = 'table_name';</code></p>
  
  <p>About the private or public synonym, as the links above say, </p>
  
  <blockquote>
    <p>ALL_CONSTRAINTS/ALL_CONS_COLUMNS describes constraint definitions on tables accessible to the current user.</p>
  </blockquote>
  
  <p>So I guess if it shows data either the synonym is public or you are the correct user for the private synonym.</p>