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