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;
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That worked perfectly.