I have a stored procedure for DB2. I’m unable to drop the procedure. I’m getting the below error while executing the DROP PROCEDURE <PROCEDURE_NAME>
command.
Error:
DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=MYSCHEMA.MyProcedure, DRIVER=3.50.152 Message: “MYSCHEMA.MyProcedure” is an undefined name. SQLCODE=-204, SQLSTATE=42704, DRIVER=3.50.152
Procedure details:
- ROUTINESCHEMA: MYSCHEMA
- ROUTINENAME: MyProcedure
- ROUTINETYPE: P
- OWNER: ROLEA
Command executed:
DROP PROCEDURE MYSCHEMA.MyProcedure;
Error:
“MYSCHEMA.MyProcedure” is an undefined name. SQLCODE=-204, SQLSTATE=42704, DRIVER=3.50.152
Additional information:
- The procedure exists in the ROUTINESCHEMA MYSCHEMA.
- My procedure has no definition
- Unable to view the stored procedure. When I try to open it in the editor, I get an ‘object not found’ error.
Question
Why am I getting this error and how can I successfully drop the procedure?
Check the SPECIFIC_NAME
. Could be you accidently created two procedures with the same name and a different set of parameters.
If so, use DROP SPECIFIC PROCEDURE ....
1
DB2 is generally case-sensitive and folds ordinary identifiers to uppercase. Use, delimited identifiers to keep the exact capitalization:
DROP PROCEDURE MY_SCHEMA."MyProcedure";