939 B
939 B
EVENTI_AGGIORNA_TOT_OSPITI
Codice Sorgente
PROCEDURE "EVENTI_AGGIORNA_TOT_OSPITI" (
p_id_evento IN NUMBER DEFAULT 0
) AS
--aggiorna la qta toto ospiti
--job aggiorna_tot_ospiti
CURSOR c_eventi IS
SELECT
id
FROM
eventi
WHERE
id = p_id_evento;
v_tot_ospiti NUMBER;
BEGIN
/*
for c in c_eventi
loop
*/
BEGIN
v_tot_ospiti := f_get_tot_ospiti(p_id_evento);
UPDATE eventi
SET
tot_ospiti = v_tot_ospiti
WHERE
id = p_id_evento;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20000, 'Errore nel calcolo del totale ospiti: '
|| sqlcode
|| ' - '
|| sqlerrm);
END;
-- end loop;
END eventi_aggiorna_tot_ospiti;```