[SQL] Client and server cursors

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Mar 4 23:08:35 CST 2003


Hi guys,

Just want discuss a little issue of cursors for Valentina Client.

As some of you know mySQL and Postgre, have client-side and server-side
cursors. 

When e.g. MySQL create client-side cursor this means that found N records
are transferred to client into its RAM, and there is no more overhead on
Server side.

Now you can ONLY read records of this cursor.

IF you want change or add or delete some record of this cursor, you need
send to server OTHER SQL command as
        "INSERT ... " or
        "UPDATE .. WHERE ID = N"
        "DELETE .. WHERE ID = N"
        
-----
What we try now implement for Valentina is ability to use the SAME cursor
API, that we use for local dbs.

So this looks as

    curs = db.SqlSelect( "SELECT ...", ReadWrite, kClient )

Now if you want do modifications of records you can do simply:

    curs.Stringfield( "name" ) = 'something new'
    curs.Update();  <<<<<<<< this send command to server.
    
€€>> What you think about this approach ?
€€>> Anybody see any potential problems with this ?
**>> I do not remember if any other db use this way? IT seems I have see
always generation of new SQL command in background...

-----
As for me I think this is really MORE EASY and more comfortable way,
Then generate new SQL string for command.

And this looks to be more effective, because again,
-- you do not spend time and resources to build SQL string
-- server do not spend time to parse it.

Data simply go by special protocol in binary form from client to server.


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