SQL Confusion

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Oct 9 05:26:09 CDT 2007


On 9/10/07 11:54 AM, "Bart Pietercil" <bart.pietercil at gmail.com> wrote:

Hi Bart,

> I am a bit confused on the correct way to update a record through sql.
> 
> What we did in RB was obtaining a read/write cursor and update the
> cursor.
> 
> Now I see that I can obtain a cursor through
> 
> Valentina.SqlSelect(
>      inQuery as String,
>      inCursorLocation as EVCursorLocation = kClientSide,
>      inLockType as EVLockType = kReadOnly,
>      inCursorDirection as EVCursorDirection = kForwardOnly
>      inBinds() as String = nil ) As VCursor
> 
> but normally in SQL I would do SQLExecute("Update......")
> 
> Will the sqlexecute raise an error when a record is part of a
> previously created cursor?
>
> I would expect so

Of course. IF that cursor Lock it then YES.
   Both RearOnly and ReadWrite locks of that cursor cause error.

BUT NOTE:
    if cursor is CLENTSIDE -- then this is snapshoot,
    and no locks in db for such cursor


> But (as I already said totally confused) when I want to work
> exclusively with SQL (no class way, so no cursor ?)
> 
> how can I "reserve" a record for updating BEFORE sending an sqlexecute
> ( "Update....").
> 
> So the confusion seems to be
> 
> I can do
> 
> SQLSelect("select anid.....,kServerSide,kReadWrite)
> 
> but then I "must" continue with class-way (cursor.Update......)

Bart, Cursor.Update()

    this is NOT Class way!!!
    this is SQL/API way in our terminology.

Please read this article:

http://www.valentina-db.com/dokuwiki/doku.php?id=paradigma:public:en:documen
tation:articles:coding_style
 
> And I want to use SQLExecute("Update...")
> 
> I hope the question makes sense....
> 
> Bart

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