create or replace procedure my_prc
(
v_a in nvarchar2,
v_b out nvarchar2
)
is
v_sid INTEGER;
v_admin nvarchar2(50);
v_name nvarchar2(50);
begin
declare CURSOR my_cursor is select id_merchant_oper from t_mer_oper order by id_merchant_oper ;
BEGIn
OPEN my_cursor ;
fetch my_cursor into v_sid ;
while my_cursor%found
loop
select trim(oper_id) into v_admin from t_mer_oper where id_merchant_oper = v_sid ;
if v_admin= v_a then
update t_mer_oper set oper_name='ygj002' where id_merchant_oper = v_sid ;
v_b := 'ygj002' ;
end if;
fetch my_cursor into v_sid ;
end loop ;
CLOSE my_cursor ;
end;
end ;