Мой код ниже работает, но есть ли лучший подход к этому?Какой будет синтаксис для удаления?
Заранее спасибо, фон моего мэйнфрейма показывает.
v_result boolean;
v_all_skills hstore [];
v_skill hstore;
v_skill_details hstore;
v_num_skills integer;
v_ii integer;
v_found boolean;
raise notice 'BEFORE (%)', v_all_skills;
select array_length(v_all_skills,1 ) into v_num_skills;
v_found = FALSE;
FOR v_ii IN 1..v_num_skills LOOP
v_skill = v_all_skills[v_ii];
v_found = v_skill -> 'skill_id' = v_skill_id;
IF v_found THEN
v_skill_details = v_skill -> 'skill_details';
**-- here I need to delete the selected v_skill from v_all_skills for the given skill_id**
EXIT;
END IF;
END LOOP;
raise notice 'v_found (%)', v_found;
raise notice 'AFTER v_all_skills (%)', v_all_skills;
raise notice 'AFTER v_skill_details (%)', v_skill_details;
УВЕДОМЛЕНИЕ: ДО ({"\" skill_id \ "=> \" aa000001 \ ",\ "skill_details \" => \ "\\" skill_level \\ "=> \\" 5 \\ ", \\" level_confirmed \\ "=> \\" true \\ ", \\" level_confirmed_by \\ "=> \\ "624 \\" \ ""}) УВЕДОМЛЕНИЕ : v_found (t) УВЕДОМЛЕНИЕ : ПОСЛЕ v_all_skills \ n ({"\" skill_id \ "=> \"aa000001 \ ", \" skill_details \ "=> \" \\ "skill_level \\" => \\ "5 \\", \\ "level_confirmed \\" => \\ "true \\", \\ "level_confirmed_by \\ "=> \\" 624 \\ "\" "}) ЗАМЕЧАНИЕ: ПОСЛЕ v_skill_details (" skill_level "=>" 5 "," level_confirmed "=>" true "," level_confirmed_by "=> "624")