I am trying to access Adabas database file using Natural program. I am using FIND command to fetch the records from Adabas DB using the descriptor (key). When I am doing so, I can see same data fetched more than 1 time. I want to know the reason,
- why same data is fetched multiple times, when the table cannot have duplicate values.
- How do we overcome this issue.
Thanks.
You do not seem to understand Adabas at all.
All fields, including descriptors, can have duplicate values.
For example; surname could be a descriptor field, and there might be multiple records with the surname Natarajan.
There is an option to specify a descriptor field has unique values, but that is something usually done by a DBA, not a programmer.
When reporting the records, include the ISN field. Each ISN represents a unique record.
FIND file WITH descriptor = value
DISPLAY *ISN descriptor
If the ISNs are different, then you were mistaken in thinking the descriptor values are unique (“the table cannot have duplicate values”). If the ISNs are duplicated, then a descriptor component is from a multiple-occurring field, and the same record is being returned multiple times.
1 Like