Bind variable in PLSQL block vs bare delete using literal value 2
Hi, Everyone,
I open this discussion as a continuation of the previous one as I think many of you may think that the issue is resolve and may not look at that discussion any more. I still have some confusion.
This is what I did
CREATE TABLE test (a NUMBER, b VARCHAR2(30), CONSTRAINT testp1 PRIMARY KEY (a));
BEGIN
FOR i IN 1..10 loop
INSERT INTO test VALUES(i,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
END LOOP;
COMMIT;
END;
CREATE OR REPLACE PROCEDURE del_by_id (p_id IN VARCHAR2)
IS
BEGIN
DELETE FROM test WHERE a = p_id;
EXCEPTION WHEN OTHERS THEN Dbms_Output.put_line(SQLERRM);
0