Open matthew-wozniczka opened 7 years ago
For simplicity I would say the ARD is preserved. I'd rather not define data-dependent rules around when it does or does not get reset.
Does that imply the driver needs to keep a copy of the ARD for every distinct type a variant column has taken on over the course of a cursor?
This would be a large burden on the implementation.
No; I wasn't suggesting that the driver keep different ARDs for different types; rather, if the driver returns a nested handle for a variant column that it returns the same nested handle, and the application must fix it as appropriate.
For structured- or collection-valued variant columns, though, it might be cleaner to simply always return a new handle. The application could simply keep ARDs for "common" bindings.
Any time the driver returns METADATA_CHANGED for a structured- or collection-valued column, any statement handle associated with that column is no longer returned for subsequent rows; the next call to SQLGetNestedHandle for the column returns a new statement handle. Applications can copy ARDs for common structures between statement handles.
Applied to docs. Reopening for DM handling.
If you have a
SQL_VARIANT
column which is of some collection/structure type on rowN
, some scalar type on rowN + 1
, and goes back to rowN
s type on rowN + 2
, should the state of the nested statement (attributes/descriptor fields) be preserved from rowN
? Or does it get 'reset' on rowN + 1
, leaving us with a 'fresh' statement on rowN + 2
?Similarly, what if it goes from
collection -> structure -> collection
, or flips between multiple different 'types' of collections/structures (For example,Address -> Point -> Address
, orAddress[] -> Point[] -> Address[]
). Should each type (now the question comes up, what defines a 'type' w.r.t. dynamic columns, etc) have it's own state?