MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Arrays in DB2 Stored Procedure

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
ed.sam13
Beginner


Joined: 09 Aug 2010
Posts: 31
Topics: 11

PostPosted: Wed Oct 21, 2015 7:01 pm    Post subject: Arrays in DB2 Stored Procedure Reply with quote

Can stored procedures created for DB2 on z/OS support arrays? I tried the example in https://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.apdv.sqlpl.doc/doc/c0052894.html but doesnt work.

This is my Native SP. Create Type doesnt throw an error but the usage of INTARRAY in the input or as other DECLARE variable type is throwing an error.

Code:
--#SET TERMINATOR #
DROP   PROCEDURE SYSPROC.MY_PROCEDURE #
CREATE TYPE intArray AS INTEGER ARRAY[100] #
CREATE PROCEDURE SYSPROC.MY_PROCEDURE
(
--INPUT VARIABLES
IN   IN_IDS                          intArray,
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Thu Oct 22, 2015 1:23 am    Post subject: Reply with quote

Unless you can find something in a DB2 for z/OS manual, the for the DB2 version you are using, it won't work in DB2 for z/OS.
Back to top
View user's profile Send private message
Mickeyd
Beginner


Joined: 02 Jan 2003
Posts: 27
Topics: 0

PostPosted: Thu Oct 22, 2015 8:49 am    Post subject: Reply with quote

the mainframe will not THROW errors or anything else.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Oct 22, 2015 11:40 am    Post subject: Re: Arrays in DB2 Stored Procedure Reply with quote

ed.sam13 wrote:
Can stored procedures created for DB2 on z/OS support arrays? I tried the example in https://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.apdv.sqlpl.doc/doc/c0052894.html but doesnt work.

This is my Native SP. Create Type doesnt throw an error but the usage of INTARRAY in the input or as other DECLARE variable type is throwing an error.


ed.sam13,

You need to use Multi row fetch with occurs on z/OS. Define a cursor and fetch the data into host variables defined as occurs.

Example can be seen here

https://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/sqlp/rbafymultifetch1.htm
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group