Link to home
Start Free TrialLog in
Avatar of toooki
toooki

asked on

Oralce procedure input parameter

I have a stored procedure that deletes a record based on the input parameter passed. I do not know what is going wrong but the below code is not working.

I have the table initially:
MyTab:
branch_name
------------------
abc
pqr
mno
srt

After I call myProd('abc') I expect to see 3 recrds except for 'abc' above.
What could be the correct oracle procedure for it....
Thanks in advance.

  Procedure myProd(branch_name IN varchar2) AS
  BEGIN
    DELETE FROM MyTab WHERE BRANCH_NAME = ' || branch_name || '; --deleting no records.
--    DELETE FROM MyTab WHERE BRANCH_NAME = branch_name; //deleting all records!!
    COMMIT;
  END;
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of toooki
toooki

ASKER

Thank you all.
That worked perfectly.