Solved

DROP PROCEDURE fails with SQL0911N  Reason code "68".  SQLSTATE=40001

Posted on 2014-01-16
2
1,449 Views
Last Modified: 2014-01-23
I'm trying to drop a very large, complex stored procedure, which calls other stored procedures. I keep getting a lock error and if fails

DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0911N  The current transaction has been rolled back because of a deadlock
or timeout.  Reason code "68".  SQLSTATE=40001

We're running DB2 v9.7 on AIX.

Why can't I drop the procedure? We plan on recreating the procedure. Should I use "CREATE OR REPLACE PROCEDURE" instead of two discrete steps of DROP then CREATE?

Sorry, I don't deal much with stored procedures and I'm just trying to help out.

Thanks!
0
Comment
Question by:data_bits
2 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39786329
yes, if you want to "recreate" anyhow, don't drop it. with the drop, you are loosing all permissions assigned to the procedure, by using the create or replace you will retain any permissions granted to roles/users.
0
 
LVL 24

Accepted Solution

by:
Tomas Helgi Johannsson earned 500 total points
ID: 39790508
Hi!

The reason why you cant drop a stored procedure and are getting -911 error is due to that another application/session is using the procedure.
Use db2top to find the session executing the SP and terminate it. Then you will be able to
drop the procedure.

Regards,
    Tomas Helgi
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now