PL/SQL (MOSC)

MOSC Banner

Bind variable in PLSQL block vs bare delete using literal value 2

edited Jul 6, 2010 6:07PM in PL/SQL (MOSC) 10 commentsAnswered
 
  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);

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center