подскажите новичку, почему if не срабатывает

_test_
Дата: 21.11.2009 18:25:16

create or replace procedure CHECK_NEW_ORDERS (id_of_order in integer) is

cursor c1 is select * from reservations_orders r where r.id_orders=id_of_order;
cursor c2( resident_count in integer, room_count in integer) is SELECT * FROM hotels h left join guest_rooms g on g.id_of_hotel=h.id_of_hotel

where
g.g_resident_count=resident_count and
g.g_rooms_count=room_count;

begin
open c1;
open c2(1,1);
if c2%found then -- не срабатывает не при found, не при notfound
update reservations_orders rr set rr.r_status=2
where rr.id_orders=19;
commit;
end if;
/* Здесь работает.
update reservations_orders rr set rr.r_status=2
where rr.id_orders=19;
commit;
*/
close c2;
close c1;

end CHECK_NEW_ORDERS;
Есть вопрос
Дата: 21.11.2009 18:41:53
_test_,

%FOUND Attribute: Has a Row Been Fetched?

After a cursor or cursor variable is opened but before the first fetch, %FOUND returns NULL. After any fetches, it returns TRUE if the last fetch returned a row, or FALSE if the last fetch did not return a row. Example 6-14 uses %FOUND to select an action.

Example 6-14 Using %FOUND

DECLARE
CURSOR c1 IS SELECT last_name, salary FROM employees WHERE ROWNUM < 11;
my_ename employees.last_name%TYPE;
my_salary employees.salary%TYPE;
BEGIN
OPEN c1;
LOOP
FETCH c1 INTO my_ename, my_salary;
IF c1%FOUND THEN -- fetch succeeded
DBMS_OUTPUT.PUT_LINE('Name = ' || my_ename || ', salary = ' || my_salary);
ELSE -- fetch failed, so exit loop
EXIT;
END IF;
END LOOP;
END;
/
_test_
Дата: 21.11.2009 18:48:07
Есть вопрос,

thank you :)