Fine Tuning

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Nov 18 22:26:24 CST 2005


On 11/18/05 6:01 PM, "Ed Kleban" <Ed at Kleban.com> wrote:

> Ok, I've read the SQL manual and so now know enough to be dangerous I guess.
> I've also gone back and stared the Reference manual a good bit.  I think I
> understand the abilities and benefits of using SQL vs native API.  What I
> don't have a good understanding of is how to mix the two when it comes to
> manipulation of subsets via VCursors and VSets.

First of all. When we say about MIX, we mean not mix in the same
function/algoroithm, but

    - in one function you an make SQL query
    - in other API searches

All depend on task.

E.g. JOINS better do in SQL.


> Specifically, If I do an SQL query to determine a subset of records of
> interest, and obtain a VCursor with say, only a RecID field, then is there a
> way I can create a VSet for the corresponding table that only includes those
> RecIDs made accessible via the cursor?

No. this is wrong think

Cursors separately, sets separately .
 
> Conversely, if I have an ArraySet containing a subset of table records of
> interest, is there are way to perform an SQL query on only that subset of
> records?

Again now. At least now .


> I'm guessing that the solution to both of these probably involves the
> creation of an temporary, intermediate table in memory or disk, that
> contains only the recID fields of the records of interest.  What I'm not
> sure about is the best way to create such a table from either a cursor
> resulting from an SQL query, or an existing Vset.
> 
> Do I just use the Vtable constructor commands to create the table manual and
> then iterate through either the Cursor or the Set manually in a loop to
> populate it?  Or is there a better, more automatic way that I'm missing?

No you try to go in hard way. No need.

Again, simples, single table searches can be made with API.

Complex JOINs, distincts with SQL.

But still, complex algorithms can be writted with help of Sets+Links for
multi table searches and Navigations, which can be more effective than SQL
joins.


-- 
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