comandos SQL*Plus


CREATE OR REPLACE del_inv (p_product_id NUMBER)
IS
Header
. v_product_is s_product.id%TYPEDeclaration
BEGIN
. SELECT id
. INTO v_product_id
. FROM s_product
. WHERE id = p_product_id;

. DELETE FROM s_inventory
. WHERE product_is = v_product_id;

Executable
EXCEPTION
. WHEN OTHERS THEN
. ROLLBACK;
. INSERT INTO exception_table (message)
. VALUES ('Ocorreu algum erro!');
. COMMIT;

END;
Exception


Anterior Se Vire em Próximo