The CSpMultiSql on the update web hit will not always be the same instance
as the one that did the select web hit.
There may have been other user who used the multi sql in between the select
web hit and the update web hit.
You could use JavaScript and a hidden field to track user changes.
Or you could have a hidden fields with the old values. Then compare
values.
Or you could only allow one row to be updated at a time, and allow users to
select the row to update from a list.
Brendan
TeamND
-----Original Message-----
From: Teplitsky, Alexander [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 11, 1999 1:16 PM
To: 'NetDynamics Developers forum'
Subject: [ND] CSpUpdate & CSpMultiSQL
Hello,
In my HTML page I have a table of 12 rows and 5 columns (60
cells). Users
can modify values in any number of cells and submit changes
by clicking a
button. In button's onWebEvent() I loop thru each row and
setValue() to
CSpUpdate object and than execute() it.
This works fine but I am not sure that this is the most
efficient way to
perform an UPDATE.
I think that ND executes UPDATE statement 60 times
regardless of the number
of rows changed by the users. Is there a way to prevent this
from happening
? I know that I can do something like this:
1) from CSpSelect dataobject driving my repeated, read
values than store
them in CSpVector, row by row.
2) getDisplayFieldValues(), again row by row, storing values
in CSpVector.
3) Compare CSpValues stored in the corresponding positions
of both vectors
and if they are different (modified by the user), do
setValue() in my
CSpUpdate object and execute() it.
This doesn't seem to be very efficient either. Can anyone
think of a better
solution ?
Does CSpMultiSQL know what data was changed and what wasn't
and generate the
appropriate SQL ?
Thanks for your help.
Alex
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the
discussion
forums, please go to:
http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]