467,154 Members | 685 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

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

Errors in stored procedure in db2

Hi all,

I am writing a Stord proc in db2 in which I am querying(select query) a
table in the database and picking 2 values.These 2 values are inputs to
the next select query and so on.Totally I have to fire 5 queries and
finally all the required fields are populated in a Temporary table.

Please let me know whats the best option to do this.I have tried to
implement it using nested cursors but its giving errors.Please let me
know how to using Loops(Fetch loop,While,For etc) in stored proc and
how to break out of a loop.Also I want to know how to use the IF ELSE
condition in stored proc.

Apr 19 '06 #1
  • viewed: 1334
Share:
1 Reply
Hi ,
If you have Linux or Unix Versoin of DB2 see
<home>/sqllib/samples/sqlproc
this folder has the SQL stored procedure samples

If you have windows the default path for the samples are C:\program
files\IBM\SQLLIB\Samples\sqlproc

It has samples for SQL stored procedure.

Apr 19 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by DB_2 | last post: by
2 posts views Thread by Dino L. | last post: by
4 posts views Thread by William F. Robertson, Jr. | last post: by
2 posts views Thread by Ford Desperado | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.