[quote]Originally posted by Marco Kalter:
[QUOTE]Originally posted by al0:
[qb] However, if you add a detail dataset and select the dataset with the collection attributes or columns as the master, the detail dataset will be populated with the collection records. [/quote]How I can find at runtime which collections I have in master dataset? How can I specify for detail dataset which of collection from master datase shall it represent?
The code used at design time in OracleData.pas is, in essence, incorrect
(at least as far as I can undestand it), as it provides not the collections present in SELECT but collections from "updating table" of that select. So it may propose some unselected columns and will not propose some explicitly selected columns (yes, later are not updatable but anyway user want to see them).
And it seems that one more issue exists
- collection are selected by the internal TOracleQuery of Master dataset completely unavailable from outside
and then reselected by detail dataset. so they are selected twice effectively wasting the memory and execution time (especially for big collections).
Shortly, it doesn't deals with selected collections, it tries to re-select it with his own SQL. It more or less Ok from collections that come from the tables, but collection may appears to select in many other ways - e.g. as resul of function calls, direct creation in the select list (select TABLE(MyNumberCollection(1,2,3,4,5)) from dual) etc. So to hanle collection (at least in read-only mode) via TDataset are need or collection-type field in TOracleDataSet or special dataset descendant like TCollectionWrapperDataset.