View previous topic :: View next topic
|
Author |
Message |
Dibyendu Mandal
New User
Joined: 08 Dec 2011 Posts: 10 Location: India
|
|
|
|
Hi,
I am facing an issue in my cobol-Db2 program.
The scenario is like-
1. I have a table T1 in which columns are C1 and C2.
C1 column contains data like 'AB1AB2AB3AB4.....'
2. T2 table contains columns as C3 and C4
C3 column have value like 'AB1','AB2',.....
Now I want a cursor which will give me a values like-
'AB1','AB2','AB3','AB4'.......
I am confused how to get the values from first table,becuase Union will give me the proper data once i get data as 'AB1,AB2 from table C1
Substr function,Array in cobol is coming in my mind.but not getting how to proceed. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
It is not clear what you are trying to accomplish. Keep in mind that what you want to do is completely clear to you, but might not be so clear to people reading your topic.
Is there some relationship between table T1 and table T2. What do you want the cursor to do for this process? |
|
Back to top |
|
|
Dibyendu Mandal
New User
Joined: 08 Dec 2011 Posts: 10 Location: India
|
|
|
|
Hi Dick,
There is no relation between table T1 and T2 tables.
Only one relation I can see is-
1. Column C1 of table T1 is the concatenation of column C3 of table T2.
Like C1 contains value 'AB1AB2AB3AB4.....'
Column C3 contains value like 'AB1','AB2'......
So my cursor should return value like 'AB1','AB2','AB3','AB4'.....
Cursor I am using as I have to send the result set to front end through Stored Procedure.
Hope I am a little bit clear now |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
No, not so clear . . .
If all you want is the AB1, ab2, etc why is the first table even used?
Why not read only table 1 and break out the "pieces"?
If there is no relationship between the tables why use both?
Maybe if you use more realistic data values, this would be more clear. |
|
Back to top |
|
|
|