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
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