Sets from Cursors Re: VCursor.AddRecord

Sims, John ayu8 at cdc.gov
Fri Dec 2 13:35:07 CST 2005


> -----Original Message-----
> From: valentina-bounces at lists.macserve.net 
> [mailto:valentina-bounces at lists.macserve.net] On Behalf Of Ed Kleban
> Sent: Friday, December 02, 2005 12:52 PM
> To: Valentina Developers <valentina at lists.macserve.net>
> Subject: Re: Sets from Cursors Re: VCursor.AddRecord
> 
> 
> 
> 
> On 12/2/05 10:31 AM, "Sims, John" <ayu8 at cdc.gov> wrote:
> 
> >     
> >>    Is there a technical reason why you could not provide the
> >> functions:
> >> 
> >>        VCursor.AsArraySet() as VArraySet
> >>        Vcursor.AsBitSet() as VBitSet
> >> 
> >> Which is different from the question:
> >> 
> >>    Is there a philisophical reason why you would NOT like 
> to provide 
> >> these functions?
> >> 
> >> 
> > 
> > Hi Ed,
> > 
> > I certainly can't answer for Ruslan,
> 
> Certainly none of us can.  We users may be many things, but 
> being Ruslan is
> not one of them.   
> -- Ya gotta wonder how well that sentence translates to Ukrainian.
> 
> > but one thing that occurred to me
> > immediately is the fact that VArraySets and VBitSets only hold the 
> > RecID's of the records and, of course, the Vcursor may hold many 
> > different fields.
> 
> Yes, but in the cases I'd want to use this I would likely 
> issue an SQL command that ONLY returned RecID fields.  In 
> fact if possible, I'd have it return no fields at all, 
> because in the end what I'm after is the bitSet or ArraySet.
> 
> > I'm not sure what the use of converting the Vcursor to a 
> Vset would be 
> > unless you just wanted to get the RecID's of the records in the 
> > Vcursor to iterate through them outside of the Vcursor...
> 
> That's exactly what I want it for.
> 
> > which would allow you to make modifications to fields not in the 
> > Vcursor, meaning you wouldn't have to request that data in 
> the first 
> > place, which lowers the amount of data moving 
> back-and-forth/network 
> > traffic ...
> 
> You make a great straight man.  How much would you charge for 
> this service on an ongoing basis?  Perhaps we can work out a deal.

Abbott and Costello
Laurel and Hardy
Kleban and Sims ---- Doesn't quite have the same ring to it :-)

That said, I'm willing to do the straight man thing for free.

As for the topic at hand, we could certainly work around this by making
sure to request RecID for the Vcursor then iterating through the Vcursor
and pushing the RecID into an Array (or custom class if you wanted to do
fancier things) but it would be nice to not have to request the RecID
and still get the benefit of being able to iterate through the RecIDs.

You know, as I'm typing here, it has occurred to me that Vset has
Append/Remove methods so we could really just do this ourselves (though,
performance-wise, probably not as fast as Ruslan could implement).  But,
we could extend Vcursor (I'm pretty sure you are an RB guy) and add a
ToBitSet and/or ToArraySet method ourselves.  As long as you remembered
to pull back the RecID in the query, this shouldn't be too difficult to
do.  Even more interesting might be if you pulled back the RecID of the
"main" table and the RecID(s) of a related table(s), you could make the
extends methods where you pass the field from the Vcursor you want to
create a Vset for then you could easily create an iterator for both the
"main" table and the related table(s).

Ok, I gotta get back to work.  Sorry for the "stream of thought" post.
I don't have time to really thing through all of this here at work.  I
hope I have made enough sense.

Take care.

-John


More information about the Valentina mailing list