Topic
  • 2 replies
  • Latest Post - ‏2014-07-07T03:46:04Z by Ajay Kulkarni
Ajay Kulkarni
Ajay Kulkarni
19 Posts

Pinned topic Stored Procedure SET RESULT SETS Array?

‏2014-06-26T13:44:37Z |
We are designing a stored procedure on DB2 for IBM i  (7.1 TR7) which returns a data structure array as a result set.
The data structure definition is below
dcl-ds OUT_ARR_AID  Qualified Dim(32000);                       
       AccountId    char(29) ;                                  
       AccountDesc  char(61) ; 
       PostEditCode char(1) ;                                   
       SBLType      char(1) ;                                   
end-ds;                                                         
                                                                
Exec Sql  SET RESULT SETS                       
              WITH RETURN TO CLIENT             
              ARRAY :Out_Arr_AID                
              FOR   :Out_NumberofAccounts ROWS; 

 

If we change the dimension to 35000, the compilation is failing, is there any limitation?

MSG ID  SEV  RECORD  TEXT                                                        

SQL5011  30     144  Position 30 Host structure array OUT_ARR_AID not defined    
                     or not usable.                                              
Updated on 2014-06-26T13:45:33Z at 2014-06-26T13:45:33Z by Ajay Kulkarni
  • krmilligan
    krmilligan
    450 Posts

    Re: Stored Procedure SET RESULT SETS Array?

    ‏2014-06-30T17:12:36Z  

    Documentation says this for SET RESULT SETS statement:

    The number of rows specified must be in the range of
    0 to 32767 and must be less than or equal to the dimension of the host
    structure array.

  • Ajay Kulkarni
    Ajay Kulkarni
    19 Posts

    Re: Stored Procedure SET RESULT SETS Array?

    ‏2014-07-07T03:46:04Z  

    Documentation says this for SET RESULT SETS statement:

    The number of rows specified must be in the range of
    0 to 32767 and must be less than or equal to the dimension of the host
    structure array.

    Thanks Kent!