0

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?

2 Answers 2

0

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 ....

Sign up to request clarification or add additional context in comments.

1 Comment

Query the catalog to extract the exact specificname (which may be a generated by Db2), and explicitly drop that specific procedure while respecting the CaSe of the specificname. Detail the result in your question.
0

DB2 is generally case-sensitive and folds ordinary identifiers to uppercase. Use, delimited identifiers to keep the exact capitalization:

DROP PROCEDURE MY_SCHEMA."MyProcedure";

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.