SQLSelect Question

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Feb 3 10:30:04 CST 2006


On 2/3/06 2:51 AM, "Chuck Pelto" <cbpelto at pcisys.net> wrote:

>> I do not see still why you need ArraySet, but if you need it you
>> can use
>> this way:
>> 
>>     cursor = db.SqlSelect( "SELECT DISTINCT f1, f2 FROM T" )
>> 
>>     arrayset = cursor.ToArraySet()
> 
> Well...RB doesn't really play with arrays all that well. For example,
> sorting is only for one-dimensional arrays. Whereas sorting a cursor
> of multiple fields is so hard with V4RB2, as I understand it.
> 
> So, getting the data and sorting IT in V4RB2 and then passing it to
> RB as an array seemed to me to be the best way to go about getting
> around RB's difficulty in managing arrays.
> 
> [1] Get an complex data structure, using the 'SELECT DISTINCT'.
> [2] Sort it using SORT BY.
> [3] Make it available as an array to RB via VArraySet.
> [4] Start 'slicing and dicing' the data into a contextual menu to
> show up in a window of an RB project. [Note: You may or may not have
> noticed the discussion going on over at RB over recusions.]
> 
> I think I can really bust some heads in programming my projects if I
> get a handle on this.
> 
> Regards,
> 
> Chuck
> P.S. Thanks for showing me how to get an arrayset. Too bad they don't
> work with strings.
> 
> P.P.S. Could that be a new feature?

1) You not correctly understand ArraySet.

    ArraySet and BitSet are special tools optimized to work
    with set of found/selected RecID numbers.

    ArraySet never will work with strings.


2) IMHO all can be done much simple

    create tmp RAM table with columns you need..inlcuding string/VarChar
    add records
    do SQL to get cursor

Now you have cursor with sorted records. Use it to build Contextual menu.

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list