467,118 Members | 925 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,118 developers. It's quick & easy.

working with a stored procedure

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
  • viewed: 1137
Share:
3 Replies
"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
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
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.

Similar topics

1 post views Thread by Compkitty | last post: by
4 posts views Thread by Rhino | last post: by
8 posts views Thread by Thomasb | last post: by
2 posts views Thread by Dino L. | last post: by
104 posts views Thread by Beowulf | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.