Why won't this update statement work?

Kristafer Vale kristafer at comcast.net
Sat Mar 13 15:29:30 CST 2004


Hmm, I guess I'm just used to things like coldfusion and what not where you
can query the database for a number of records and then loop through those
records changing one value as you go and automatically updating the database
as it goes. I confess to not completely understanding cursors and their
uses. I assumed that they were just Valentina's way of selecting records now
I see it actually copies the data in question and allows you to perform some
operations on that copy of the data, but then how does it put the data back
to the original table? I'm confused, and I've re-read the docs many times,
could you explain cursors a bit more to me? Offline is fine,
kristafer at comcast.net

Thanks.

Kristafer S. Vale
VK-iNTERACTiVE
6011 Medici CT #301
Sarasota, FL 34243
407-924-3025


-----Original Message-----
From: valentina-bounces at lists.macserve.net
[mailto:valentina-bounces at lists.macserve.net] On Behalf Of Ruslan Zasukhin
Sent: Saturday, March 13, 2004 2:58 PM
To: valentina at lists.macserve.net
Subject: Re: Why won't this update statement work?

On 3/13/04 9:51 PM, "Kristafer Vale" <kristafer at comcast.net> wrote:

Hi Kristafer,

> The reason I want to do this is that I need to query the database for the
> record information and then feed that info into my next command which will
> update the previous information with some new data. I can't think of a
> better way to do it then, use select in a cursor, then get info from the
> cursor set to a variable, then use said variable to make new sqlExecute
> command to update info. Am I missing something?

1) if you already have cursor, then just use its functionality!

    curs.UpdateRecord()

This will be faster than
    a) PREAPRE new SQL command STRING
    b) PARSE it for Valentina
    C) execute update

More simple execute update skipping a) and b) steps.
You see?


2) IF you very want to use SQL way, then your cursor should not lock
records, use NoLock parameter


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

_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list