By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,558 Members | 1,068 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,558 IT Pros & Developers. It's quick & easy.

working with a stored procedure

P: n/a
Hi gurus, i have written a stored procedure in a file sampleproc.sql
DB2 V8.2 AIX V5.3

Is this first step correct?
If yes, what are the next steps?

Sorry for such a silly question but am a newbie to this.

Thanks.

May 11 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"shsandeep" <sa**********@gmail.com> wrote in message
news:b4******************************@localhost.ta lkaboutdatabases.com...
Hi gurus, i have written a stored procedure in a file sampleproc.sql
DB2 V8.2 AIX V5.3

Is this first step correct?
If yes, what are the next steps?

Sorry for such a silly question but am a newbie to this.

Thanks.


1. Edit the file and put a @ delimiter after the last END statement (replace
the ";" if there is one). Leave all other ";" in the other lines of the SP.

2. connect to the database (db2 connect to sample).

3. Using the DB2 Command Window, issue the following command to create the
SP:
db2 -td@ -vf sampleproc.sql

4. Test the stored procedure by issuing the following command:
db2 "call proc-name (inparm1, inparm2, etc)"
May 11 '06 #2

P: n/a
Here's how i do it.

Open a db2 command window and CONNECT TO the database.
End all lines with "\" (though comments do not need it.)
End all commands with ';'.
Copy & paste procedure into the db2 window.
See if it was successful or not.
COMMIT

It all depends on what sort of process you want to use.

B.

May 11 '06 #3

P: n/a
If you are now familiar with creating procedures from command line, you
can think about getting modern development environment, which will help
you to build and deploy stored procedures.

Go here:
http://www.ibm.com/software/data/db2/udb/viper/

and download DB2 Viper Developer Workbench. Eclipse based tool,
dedicated to DB2 version 9 -- what is very nice, it also works with DB2
v.8 !!!

-- Artur Wronski

May 11 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.