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.
Mark A - 11 May 2006 07:37 GMT
> Hi gurus, i have written a stored procedure in a file sampleproc.sql
> DB2 V8.2 AIX V5.3
[quoted text clipped - 5 lines]
>
> 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)"
Brian Tkatch - 11 May 2006 13:52 GMT
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.
Artur - 11 May 2006 21:19 GMT
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