oracle11g - Iteration on result of a sql -
i having result 1 sql. ex: select * employee. want iterate each record of above sql , update column of employee table differrent values.i using oracle database.
code of is:
declare cursor cur_schedule_parameter select schedule_parameter_type (parm_typ_cd, parm_operand_1_val, parm_operand_2_val, sched_id, sched_parm_id, void_evnt_id, parm_oper_typ_cd, add_evnt_id) schedule_parameter parm_operand_1_val in ('c|s', 's|c'); v_sched_param_array schedule_parameter_type_tab; begin if cur_schedule_parameter%isopen close cur_schedule_parameter; end if; open cur_schedule_parameter; fetch cur_schedule_parameter bulk collect v_sched_param_array; indx in v_sched_param_array.count loop update schedule_parameter set void_evnt_id = indx sched_parm_id = v_sched_param_array (indx).sched_parm_id; end loop; exception when no_data_found null; when others null; end;
i created type schedule_parameter_type , schedule_paraeter_type_tab (collection array). please suggest me how can this?
while writing loop need give follows in example missed
for indx in 1 .. v_sched_param_array.count loop update schedule_parameter set void_evnt_id = indx sched_parm_id = v_sched_param_array (indx).sched_parm_id; end loop;
please let me know if answer not help.
Comments
Post a Comment