Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / May 2006

Tip: Looking for answers? Try searching our database.

working with a stored procedure

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shsandeep - 11 May 2006 07:06 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.