View previous topic :: View next topic
|
Author |
Message |
rahuindo
New User
Joined: 09 Apr 2008 Posts: 83 Location: Chennai
|
|
|
|
Hi,
We're writing a new Cobol-DB2 stored procedure which has to return lot of data.
The data layout for my result-set is something as follows:
01 Result-Set
05 Static Data
....
05 Static Data10
05 Group 1 occurs 0 to 3 times depending on numItems
10 Group 1 variables
10 Group 1 variables
10 Group 2 occurs 0 to 10 times depending on numChars
Note: Since, it is a pretty big layout I am just giving a glimpse of how the layout is.
For a single call, the stored procedure may have multiple records with the above layout. So, let us say if the Input is Employee ID, I may have to return 2 records for that Input - one for the manager and the other for the employee. Sometimes, the hierarchy may go beyond the manager as well.
This stored procedure will be accessed by a Websphere program.
Now, I am thinking of returning the results in XML format. I do not want to store the output result-set in DB2 and hence I am not using the Db2 in-built XML functionalities. The reason is that this stored procedure may be called more than 10000 times in a day and I may never be requiring the I/O data. So, it will be pretty costly to save the I/O data in XML format in Db2. Hence, I want to process and return the output using a global-temp table.
Hence, I am planning to do the following:
1. Retrieve the data from various application tables and put the data in the above copybook layout
2. Use the COBOL XML Generate statement to generate the XML tags
3. Create a global-temp table with column type as CLOB. Insert the XML data in a CLOB column and then return the result-set to the calling system.
However, DB2 V10 for z/OS does not support CLOB column type in Global Temp table nor it supports the XML column type. So, I am stuck in the above plan.
There is another option for me - I can declare an O/P parm in the Stored Procedure for a CLOB/BLOB type variable and string all the XML result-sets (employee+manager) and pass the result-set using the CLOB/BLOB type. But that will limit the number of result-sets because the maximum length one result-set can be around 35000 bytes.
Is there any other option which I can take? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
split the data structure into multiple cursor's and let front end manage to prepare matrics as needed to display on the screen.
Something like a metadeta cursor and detailed data cursor. If I understand you rightly. |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
I admit to being confused...
You don't want to store the data in DB2, so you're going to make a temp table?
Isn't a temp table still a table? Or are those now stored in memory?
You might call it 10000 times a day, but not need the output? If you don't need it, then why are you storing it every time? |
|
Back to top |
|
|
|