Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cursor - URGENT, PLEASE!!!

Status
Not open for further replies.

zik

Technical User
Jan 23, 2006
28
HR
Can someone please tell me why this code is not working?
CURSOR c_1 IS
SELECT call,
call2,
call3,
call4
FROM mytab
WHERE ((caller = 'I') and (call_in = ' '
OR call_in is null) and (call_referrer = 'A'
OR call_referrer = 'B' or call_referrer = 'X' or call3 = 'A' or call3 = 'B')
AND (call_date >= beg_date and call_date <= end_date));
begin
FOR i in c_1 LOOP
if (call2 = '06B' or call3 = '0007' or call3 = '0507' ) then
begin
if call_ref = 'A' then
sum1ra := sum1ra + 1;
elsif call_ref = 'B' then
sum1rb := sum1rb + 1;
elsif call_ref = 'X' then
sum1rx := sum1rx + 1;
elsif call_cons = 'A' then
sum1ca := sum1ca + 1;
elsif call_cons = 'B' then
sum1cb := sum1cb + 1;
end if;
end;
end if;
end loop;
end;
I am getting an error that says call2 must be declared.
I do have call2 in my table.
What is causing the error?
thanks,
zik
 
Use i.call2, i.call3 within loop or declare variables call2, call3 etc. and fetch cursor into them.
 
Sorry you had to waste your time on this sem.
I realized what the problem was but could not get here on time to advise of it.
Thanks anyway for responding very quickly.
zik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top