the scope of Virtual fields

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Jan 25 17:06:10 CST 2003


on 1/24/03 11:33 PM, Elizabeth Robar at erobar at earthlink.net wrote:

Hi Elizabeth,

> Hi, all.  Just to introduce myself, I'm a Visual Basic/Access/SQL
> Server programmer who's had to turn to REALBasic and Valentina in order
> to cater to the Mac world.  For better or worse, here I am!

Welcome. 

> I'm working with a database with multiple related entities (through
> VObjectPtr's) and am trying to figure out the best way to access the
> data. 

> As I understand it, I can make an old-style cursor
>    (SELECT * FROM baseobject1, baseobject

> 2) and access mycursor.Field(1, 2...).GetString(),

> or I can take advantage of the Valentina objects for REALBasic and instantiate
> my baseobjects and directly access their values (mybaseobject.myfield.value).

But this is old way for Valentina.
Do not access fields via BaseObjects for now.
Please use SQL and cursors.

In 2.x I will add missing feature for V4RB API -- BitSets.
And some functions to do Find().
Then RB developers will be able work with BaseObjects and do searches even
without SQL. This way can be faster for simple things.


> The problem comes in wanting to elegantly retrieve data from 2 or more
> baseobjects at once: do I have to use a cursor (or 2 VBaseObjects set to the
> appropriate records), or is it possible to make a Virtual Field in baseobject1
> that actually retrieves data from baseobject2?

You can use cursor built as normal SQL JOIN.


> I guess I'm really asking the scope
> of Virtual fields in BaseObjects: can they only refer to fields within
> that baseobject (e.g. FullName = CONCATE(FirstName, ' ', LastName)), or
> is it possible to have them refer to fields in another (related)
> baseobject?  I'd like to have a setup with
> 
> baseobject1:
> fielda
> fieldb
> fieldc (VObjectPtr to baseobject2)
> fieldd = SELECT fieldx FROM baseobject2
> 
> baseobject2:
> fieldx
> fieldy
> fieldz
> 
> Is such a thing possible?

Right now BaseObject methods work in the scope of single table only.

In future will be added some features to access related tables,
But this must be made very careful.

If such method will access only one related record, this is easy and fast.
But if such method will start calculation on 1000 related records, just
image time...

More correct for such big calculations, keep in Table1 cached value, and
recalculate it when needed

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list