Questions re. Data Rows, Transactions

Ruslan Zasukhin sunshine at public.kherson.ua
Fri May 7 09:55:58 CDT 2004


On 5/7/04 7:39 AM, "Phil" <philip at accessitsoftware.com> wrote:

Hi Phil,

> Hi, I'm a bit of a Valentina newbie....
> 
> 1) I was wondering if there is such an object (or concept) as a
> 'DataRow' in Valentina. I.e perform a query, get back a VDKC_Cursor. If
> that Cursor contains multiple rows, can I treat each row as some sort of
> Valentina DataRow object?

> Each time I want to call 'NextRecord()' and treat it as an entire row
> (and for example pass the entire row around the application by
> reference), not as a whole lot of fields within that row.

I see. No we do not have such object.
You think this will be useful?

At last of end you can very easy implement this self!

You can make small class which will copy VDK_Cursor field values of
The current record.

You can in subclass of VDK_Cursor overrdide SqlSelect() to return not
VDK_Cursor but your wrapper or subclass of VDK_Cursor which will collaborate
with that DataRow.

Right?

 
> 2) If there is such a thing as a DataRow object, can I then perform an
> update on it? I.e if I have a row with 10 fields, ANY of which may have
> changed, I don't want to have to write a whole lot of SQL saying "if
> this field changed, update it" and "if that field changed, update it",
> etc etc.

And Valentina's cursors allow you do exactly this easy.
Phil, in Valentina this work in this way:

1) let you have VDK_Cursor curs;
    which have 10 fields.

2) now you can change only 2 fields:

    curs.Get_Field("f1").SetString("aaa")
    curs.Get_Field("f6").SetString("bbb")

Now fields know that they are dirty.

3) you can now without ANY SQL simply say

    curs.Update()

DONE.

Cursors in Valentina are VERY SMART.
And We do not use DataRow on this reason.


Oh! idea.
I think that you can simply send by reference VDK_Cursor itself.
How this will differ from DataRow ???

Using DataRow in some functions you still will need iterate in loop fields
of DataRow, right? 

So what difference? Just thank about VDK_Cursor as about DataRow.


> I'd like to be able to change the field(s) as I choose, then tell
> Valentina to take the row and perform updates if necessary.

No problems, you can do this using API of VDK_Cursor class.
No need to build SQL string.

> I admit 
> there are times when this would be difficult or impossible, such as when
> the row contains results from multiple tables, or concatenated columns...

Right. Cursor can be updated only if it is for single table.
VDK_Cursor even have such functions for check if you can modify records.
  

> 3) I also saw in todays messages that transactions are not supported. Is
> there any plan to implement this?

Yes of course.

> Help! If not, this'll have a major impact on our SQL complexity and the
> way in which we write our application.

I think you worry in the first turn about LOGICAL rollback, yes?

When we will ship Valentina 2.0, our immediate major tasks will be
    a) port to Linux
    b) transactions AT LEAST for logical rollback.
            may be also for recovery after system failure.

So I think this will take yet 4-6 months from now.


-- 
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://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list