Stored Procedure question

JH

Stored Procedure question
Is there a way to write a DB2 stored procedure to do
SELECT against 10 tables and SELECT only 1 column from
each table, then pass the value(10 columns from 10
tables) back to the calling program. We are z/OS DB2
V71 shop. using procedure builder. Thanks in advance
Sample code will be super.

Joe






__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Agus Kwee

Re: Stored Procedure question
(in response to JH)
Joe,

If you are using stored procedure builder to write a DB2 Stored Procedure, then you must be coding your stored procedure in SQL or Java Progamming Language.
If your SELECT statement against 10 tables produces no more than 1 result
row, you can use the SELECT INTO statement that can specify 10 call parameters to return the result values to the caller. If the SELECT result has more than 1 row, you must use cursor to define the SELECT in the stored procedure and you probably should use RESULT SET to return the values to the caller.

Regards,
Agus Kwee
Themis Training
http://www.themisinc.com


----- Original Message -----
From: Joe Huang <[login to unmask email]>
Date: Wednesday, January 19, 2005 9:18 am
Subject: [DB2-L] Stored Procedure question

> Is there a way to write a DB2 stored procedure to do
> SELECT against 10 tables and SELECT only 1 column from
> each table, then pass the value(10 columns from 10
> tables) back to the calling program. We are z/OS DB2
> V71 shop. using procedure builder. Thanks in advance
> Sample code will be super.
>
> Joe
>
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Find what you need with new enhanced search.
> http://info.mail.yahoo.com/mail_250
>
> -------------------------------------------------------------------
> --------------
> Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives
> and home page at http://www.idugdb2-l.org/archives/db2-l.html.
> From that page select "Join or Leave the list". The IDUG DB2-L FAQ
> is at http://www.idugdb2-l.org. The IDUG List Admins can be
> reached at [login to unmask email] Find out the latest on
> IDUG conferences at http://conferences.idug.org/index.cfm
>

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm