Home » SQL & PL/SQL » SQL & PL/SQL » Help in collections
Help in collections [message #270011] Tue, 25 September 2007 07:18 Go to next message
thisisnatesh
Messages: 92
Registered: March 2007
Member
Hi
i have a following PLSQL block.

DECLARE
TYPE T IS TABLE OF NUMBER;
T1 T:=T(7788,7839,7902);
type tab_emp is table of emp%rowtype index by binary_integer;
t_emp tab_emp;
begin
.
.
.
end;

from the above block i want to use collection
and find the emp records excluding the
given employee no's.
i.e.,
select *  bulk collect into t_emp
from emp where empno != <collection values>
.


Please help me in this regard

Thanks in advance

Natesh
Re: Help in collections [message #270036 is a reply to message #270011] Tue, 25 September 2007 08:45 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
"not in (select * from table(t1))"

Regards
Michel
Re: Help in collections [message #270054 is a reply to message #270036] Tue, 25 September 2007 09:26 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
You'll need to declare the Type of T1 as a TYPE in Sql to get that to work.
Re: Help in collections [message #270084 is a reply to message #270054] Tue, 25 September 2007 12:14 Go to previous message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Oh! yes, this is right.

Regards
Michel
Previous Topic: cluster (merged)
Next Topic: Help : Problem with Limit clause in BULK COLLECT
Goto Forum:
  


Current Time: Wed Dec 07 16:51:35 CST 2016

Total time taken to generate the page: 0.10292 seconds