Пожалуйста, попробуйте следующий код процедуры:
CREATE OR REPLACE PROCEDURE SHADI.filling_conditional
as
c_deposit_amount deposits_table.deposit_amount%type;
c_currency_code deposits_table.currency_code%type;
c_customer_number deposits_table.customer_number%type;
cursor filling_cursor is select deposit_amount, currency_code, customer_number from deposits_table for update;
BEGIN
OPEN filling_cursor;
LOOP
FETCH filling_cursor into c_deposit_amount, c_currency_code, c_customer_number;
EXIT WHEN filling_cursor%notfound;
update deposits_table
set conditional_flag = case
when c_deposit_amount > 1000 and c_currency_code = 'JOD'
and (select customer_info.sex
from customer_info
where customer_info.customer_number = c_customer_number) = 1
then 1
else 0
end;
END LOOP;
CLOSE filling_cursor;
END filling_conditional;
/