0

I have to create a procedure to delete all products supplied by vendor x and all references in a another table called tab_line. Not sure if I'm doing it right, but it states that I'm missing an expression when I run this code. Any help or a better way to do this would be appreciated!

CREATE OR REPLACE PROCEDURE deleteproducts_test
(x in number)
AS
BEGIN

UPDATE tab_line 
SET p_code = NULL WHERE v_code (SELECT v_code FROM tab_product 
WHERE v_code = x);

DELETE FROM tab_product WHERE v_code = x;

END;
/
PhiOrder
  • 5
  • 1
  • 5

1 Answers1

0

You can achieve the same with this :

UPDATE tab_line 
SET p_code = NULL WHERE v_code = x;
Ash
  • 2,575
  • 2
  • 19
  • 27