[DUG] SQL Update
Rohit Gupta
rohit at cfl.co.nz
Wed Jul 20 16:18:23 NZST 2005
If you are using the table then this could happen.... the table reads
all values of the row in and overwrites them all. You need to use
queries.
Date sent: Wed, 20 Jul 2005 14:55:44 +1200
From: "Eion McIntosh \(Christchurch\)" <e.mcIntosh at ppcs.co.nz>
To: "Delphi List Group" <delphi at ns3.123.co.nz>
Subject: [DUG] SQL Update
Send reply to: NZ Borland Developers Group - Delphi List <delphi at ns3.123.co.nz>
<mailto:delphi-request at ns3.123.co.nz?subject=unsubscribe>
<mailto:delphi-request at ns3.123.co.nz?subject=subscribe>
Hi
We have a program which runs each a user starts system we have
to check whether a program is the background is still running by
checking through the server active programs list that you can see
from Task manager. If the program find the background process is
not running it reset a variable on an SQL table, so that the next user
that logs in, without knowing, automatically start the program
running again.
We are having the occasional occurance of more than 1 copy of the
background process running and have found that this variable that
is being check is being reset to some process which we can't find
what it is. A few people believe it is the checking program resetting
this value when it does not think this process is running, when is
actually is still running. We have check with SQL logs to find when
the variable is being reset and have found when it is doing it, but it
is only reseting one field, where we have the checking program
update two fields on the record, one being a description, so we
knew that this program was doing the resetting.
The update of the SQL table is very simple:
If SQL.Field1 = 1 then
begin
SQL.Edit;
SQL.Field1 := 0;
SQL.Field2 :-= SQL.Feild2 + ' Reset';
SQL.Post;
end;
Does any think or know of any possible reason that if this logic is
resetting the field1, that is would update field2 at the same time?
When testing the log showed both fields being updated but running
live only field1 is begin reset, so this is why I can't see this logic is
causing our second copy of the background process to start
running.
Regards
Eion McIntosh
PPCS Ltd Regards
Rohit
====================================================
==================
CFL - Computer Fanatics Ltd. 21 Barry's Point Road, AKL, New
Zealand
PH (649) 489-2280
FX (649) 489-2290
email rohit at cfl.co.nz or r.gupta at xtra.co.nz
====================================================
==================
More information about the Delphi
mailing list