Dropping a DB2 Stored Procedure

5 pts.
Tags:
AS/400 stored procedures
DB2 stored procedures
iSeries DB2
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

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    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
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following