title: use nested table value in where clause(oracle)
body: <p>i am fairly new to the <code>Oracle DBMS</code> and would like to know how to use a member of a nested table in a where clause<br/><br/>
  <b>specifically</b><br/>
  i have a nested table named poll_nest<br/></p>
  
  <pre><code>   SQL&gt; desc poll_nest
       Name                                      Null?    Type
      ----------------------------------------- -------- ----------------------------
  
      ID                                                 VARCHAR2(20)
      CID                                                VARCHAR2(20)
  </code></pre>
  
  <p>which was created as follows</p>
  
  <pre><code>create or replace type voter_arrive as object(id varchar(20),cid varchar(20));
  create or replace type poller as table of voter_arrive;
  </code></pre>
  
  <p>and then it was inserted into the election table as poll_nest</p>
  
  <pre><code>    SQL&gt; desc election;
      Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
  
       REGION                                             VARCHAR2(20)
       STIME                                              TIMESTAMP(6)
       ETIME                                              TIMESTAMP(6)
       VOTES                                              POLLER
  </code></pre>
  
  <p>i need to take some actions based on the value of the <code>cid</code> attribute of poll_nest that is currently entered(like incrementing a value based on the cid)<br/><br/>
  so i used an <code>after trigger</code> in which i did this:<br/></p>
  
  <pre><code>select distinct t.cid into voted from election e,table(e.votes) t where t.cid=:new.votes.cid;
  </code></pre>
  
  <p>but i get a compilation error.
  i saw <a href="https://stackoverflow.com/questions/20232794/oracle-trigger-on-nested-table">this</a> answer and this too:
  <a href="https://stackoverflow.com/questions/19666943/oracle-nested-table-predicate-in-where-clause">Oracle Nested Table predicate in where clause</a><br/>
  but couldn't understand how they work..<br/><br/>
  <i>could someone please help me with the syntax?</i></p>