Comparing the resulset of cursor with table column data [message #404648] |
Fri, 22 May 2009 10:56  |
prachij593
Messages: 266 Registered: May 2009
|
Senior Member |
|
|
for rec in ( select department_id, department_name from table1)
loop
/*if rec.department_id falls in or exists in list of geographical area ( area_cd from some table which is a result of
two or more table))*/
then
<perform some action using rec.department_id >;
end if;
end loop;
What is the best approach to write for pseudo code below.
if rec.department_id falls in or exists in list of geographical area ( area_cd from some table which is a result of
two or more table))
Many thanks in advance
[Updated on: Fri, 22 May 2009 11:14] by Moderator Report message to a moderator
|
|
|
|
|
|
Re: Comparing the resulset of cursor with table column data [message #404657 is a reply to message #404656] |
Fri, 22 May 2009 11:50   |
prachij593
Messages: 266 Registered: May 2009
|
Senior Member |
|
|
Thanks Sir.
There are multiple conditions. eg,
for rec in ( select department_id, department_name from table1)
loop
if rec.department_id = '999' then ( this is not compared with resulset)
< action A>
end if;
if rec.department_id = '005' then
< action A>
end if;
/*if rec.department_id falls in or exists in list of geographical area ( area_cd from some table which is a result of
two or more table))*/
then
<perform action A using rec.department_id >;
end if;
end loop;
[Updated on: Fri, 22 May 2009 11:51] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|