Imaginecorp
IS-IT--Management
Why in Gods name would an Update Trigger on a table fire when I issue a Select statement? Select does not move the record pointer as far as I know and also during tests I have done, does it?
Here is the scenerio:
I have Triggers in a local table (Unit_master). The Update trigger is supposed to fire when a value in the field changes. The trigger runs a procedure in the stored procedures in the Dbc. This procedures updates the same table name (unit_master) on a remote Server.
When the unit master form is shown, it (the form) executes a method that has a select statement. This is making the Update Trigger fire when Nothing in the table has even had a chance to change. I have run the debugger, trace etc and there is nothing in the form that executes a replace.
Here is the Select statement:
I have spent half the night and all of this morning trying to figure out why the update trigger is firing immediately after or during the Select.
Has anybody experienced this or can see anything in my code that could be the culprit.
(The select gets about 150,000 records in about .001 second so the macros are ok)
Here is the scenerio:
I have Triggers in a local table (Unit_master). The Update trigger is supposed to fire when a value in the field changes. The trigger runs a procedure in the stored procedures in the Dbc. This procedures updates the same table name (unit_master) on a remote Server.
When the unit master form is shown, it (the form) executes a method that has a select statement. This is making the Update Trigger fire when Nothing in the table has even had a chance to change. I have run the debugger, trace etc and there is nothing in the form that executes a replace.
Here is the Select statement:
Code:
Select Unit_master.ordinal,Transform(Unit_master.unit_id) As unit_id,Unit_master.unit_type,;
Unit_master.equip_length,Unit_master.license,Unit_master.equip_use,Unit_master.equip_status, ;
TRANSFORM(Unit_master.ready_dt) As ready_dt,Unit_master.equip_class, ;
TRANSFORM(Unit_master.next_maintenance) As next_maintenance,;
TRANSFORM(Unit_master.next_inspection) As next_inspection ,;
TRANSFORM(Unit_master.next_registeration) As next_registeration, ;
TRANSFORM(Unit_master.hub_tot) As hub_tot ;
FROM Unit_master ;
WITH (Buffering = .T.) ;
WHERE (Unit_master.org_id $ (HomeID)) ;
AND !Deleted() &cFilterString ;
ORDER By &cOrderBy ;
INTO Cursor UnitCursor
** Unit_master.org_id $ (HomeID) displays all company locations
** &cFilterString contains something like:
cFilterString = Iif(pValue1 = "<< All >>",""," AND Unit_master.unit_type = pValue1 ") &&&Pvalue1 = parameter
** &cOrderBy contains something like:
cOrderBy = "Unit_master.unit_id "
I have spent half the night and all of this morning trying to figure out why the update trigger is firing immediately after or during the Select.
Has anybody experienced this or can see anything in my code that could be the culprit.
(The select gets about 150,000 records in about .001 second so the macros are ok)