Re: Running Count on Multivalue Attribute



Thanks for your replys and sorry for not providing enough info at the
start.

Dawn, you're spot on with what I'm trying to achieve. We're using
Unidata 6 and I'm looking to create flattened SQL views (using the
unnest funtionality) so that the data can be accessed using odbc, jdbc
or similar. The purpose of the count is, as you mentioned, to provide a
way of recording the order of the multivalues when they are flattened
out into separate logical tables. The documentation from IBM suggests
that the @NV or @VALUE.COUNT variables together with an association
should provide this functionality, but that's not working for me and
unfortunately there weren't any examples in the docs.

Thanks for your help so far

Cheers
Alex

dawn wrote:
> alfmars wrote:
> > Hi
> >
> > I'm pretty new to Unidata and multi-value databases, and need some help
> > with counting values in a multivalue attribute.
> > I need to create a dictionary item that lists a running count of an
> > associated multi-value attribute, so if I queried the file using
> > something like LIST ORDERS ORDER_NUM COUNT_ORDER_NUM I'd get an output
> > like:-
> > A123 1
> > A234 2
> > A456 3 etc
> > where ORDER_NUM and COUNT_ORDER_NUM are associated multivalue
> > attributes.
>
> If I am understanding, I have seen this done when doing ODBC against
> UniData data. Because the view splits out the association into a
> logical table you lose the ordering. Using UniData SQL, you can use
> another means to get this number (I'm forgetting that now but it is
> well documented IIRC), but you cannot create a UniData view with this
> number (or at least you could not with UniData 6.1).
>
> Is that the purpose? If so, I have done that and I'm sorry I don't
> recall how. I recall adding an I-descriptor that counted, so it was an
> MV field that was 1, 2, 3, 4, 5, ..., n and added the association to
> this I-desc.
>
> If you are not doing this for ODBC purposes, then perhaps you could
> give us more of a clue of what you would be using it for. There might
> be other ways to address the end goal. --dawn

.



Relevant Pages