View previous topic :: View next topic
|
Author |
Message |
vijayamadhuri
Active User
Joined: 06 Apr 2005 Posts: 180
|
|
|
|
1)What does the statement "multiple occurrences of a particular child segment " mean with respect to wins.
2)What is the need to have the multiple occurrences.Do all the occurrences contain the same information.or do thay represent the different fields of a segment .
3)How do we access an nth occurrence of a segment.
We have functions to acess the first and the last occurrences but say there are 5 occurrences and we want to access the 2,3,4 one.How do we do that?
Please corect me if I am wrong abou any concept here. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Hi vijayamadhuri,
Quote: |
1)What does the statement "multiple occurrences of a particular child segment " mean with respect to wins. |
Multiple occurrences of a child segment means there are more than one value of child for a perticular parent.
Quote: |
2)What is the need to have the multiple occurrences. |
Assume a case where you have to make a database of student for different subjects. Student info will be in parent segment and courses covered should be in child segment. where a student having more than one course would be having more than one child segment.
Quote: |
Do all the occurrences contain the same information.or do thay represent the different fields of a segment . |
All the occurrences contain different info of same type.
Quote: |
3)How do we access an nth occurrence of a segment. |
Suppose u r giving a GNP call to child then u can put a counter in GNP call if CALL RETURN CODE is SPACES. then by comparing the counter u can access perticular occirrences.
Regards,
Priyesh. |
|
Back to top |
|
|
sudhaaa
New User
Joined: 24 Mar 2005 Posts: 51
|
|
|
|
Hi,
May I know how?
Regards,
Sudhaaa. |
|
Back to top |
|
|
sudhaaa
New User
Joined: 24 Mar 2005 Posts: 51
|
|
|
|
Hi Madhu,
Hope you need to study once again the basic concepts.
Suppose consider one simple example as in book.
1st level - VENDOR
2nd level - ITEM
3rd level - LOCATION
In VENDOR segment you have diff fields describing VENDOR personnel details like his CODE, NAME etc.. similarly ITEM and LOC.
One VENDOR can sold diff ITEMs in diff LOCs. So, now if you wanna crate a HDBMS, you have to create a DBD with one ROOT segment and CHILD segments. In PCB you specify PARENT=....... for each SEGM field other than for ROOT segment.
Now for your question
Quote: |
1)What does the statement "multiple occurrences of a particular child segment " mean with respect to wins. |
One ITEM can sold in diff LOCATIONs. So, multiple occurences for LOCATION.
I hope you know about TWINs, two or more of segment occurences of same type, having same parent are TWINS. In the example you can say LOCATIONs are TWINs and as well as multiple occurrences of a particular child segment. Just think if ITEM has one more child segment at 3rd level namely PRICE. Then you can say all LOC occurences are TWINs, but multiple occurrences of a particular child segment are both LOCs and PRICEs.
A bit confusing, I think. Sorry,if it is so.
Quote: |
Do all the occurrences contain the same information.or do thay represent the different fields of a segment . |
Then why we need of diff SEGMENT occurences.
Quote: |
3)How do we access an nth occurrence of a segment. |
Priyesh, can you explain me how to set counter for GNP call. My thought was( may be its a turnaround method) use GU call to set position at that level, issue successive GN calls.
I also expecting effecient way than me.
Regards,
Sudhaaa. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Hi Sudhaaa,
Quote: |
Priyesh, can you explain me how to set counter for GNP call. |
What I meant to say was...to give a GNP Call & if RETURN CODE = SPACES ..means first occurrences of child got found.......So there u can add 1 to any counter (initialized to zero earlier)......
And again perform the GNP Para for the same parent, again if RET CODE is SPACES....means u got next occurrence of child.....Here again the value of counter will be increamented......this process will continue till u get END OF DB....that is RET CODE "GE" or "GB".........
I hope I was clear.....If you have any doubt ...get back.....
Regards,
Priyesh. |
|
Back to top |
|
|
sudhaaa
New User
Joined: 24 Mar 2005 Posts: 51
|
|
|
|
THANKS |
|
Back to top |
|
|
|