5 pts.
 Dropping a DB2 Stored Procedure
In my DB2 stored procs I always first drop the procedure and then do a create statement.  Is there any way I could say something like...if exists (select * from sysroutines where routine_name = 'procname') then drop procedure procname;  ?   I tried this, but the proc doesn't like the IF statement as the first line.  Has anyone tried this?

 

 

 



Software/Hardware used:
iSeries
ASKED: October 15, 2009  5:32 PM
UPDATED: October 15, 2009  10:38 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

In my DB2 stored procs I always first drop the procedure…

That sounds a little like you want the stored proc to drop and recreate itself. Can you give a little more description of what you need? I suspect that perhaps “drop the procedure” can use different wording.

Tom

 108,310 pts.