Subject | trigger/procedure problem |
---|---|
Author | ebz |
Post date | 2005-09-06T20:22:19Z |
Hi!
Just noticed a problem with the following. The field 'variant' locks in my
Delphi program after I use this trigger with a TIBDataset component, then
switch and use a DBEdit field to make another change. Is it the trigger or
the component that hangs the field? How to tell?? It only lets go if I
completely close the program, not just commit everything. Other field
triggers (designation) work ok, which makes me suspect the procedure.
CREATE TRIGGER CHNG_VARS FOR DESIGNATION ACTIVE BEFORE UPDATE POSITION 1 AS
BEGIN
if (new.variant<>old.variant)then
if (old.nl2>0 and old.nl3=0) then
begin
execute procedure
change_svar(old.cl1,old.designation,old.variant,new.variant);
end /*master variant changes*/
END
CREATE PROCEDURE CHANGE_SVAR (
CL1M SmallInt,
DESIG VarChar(100),
DESIGVARPRE VarChar(100),
DESIGVARPOST VarChar(100))
AS
declare variable id integer;
declare variable nl3 integer;
BEGIN
for
select desig_recno, nl3 from designation
where designation=:DESIG and variant=:Desigvarpre and cl1=:cl1m
into :ID,:nl3
do
begin
if (:nl3>0) then
begin
update designation
set variant=:Desigvarpost,
designation.ldate='now',
designation.luser='procCV'
where desig_recno=:id;
end /*if (:nl3>0) then*/
end /*for select do */
END
[Non-text portions of this message have been removed]
Just noticed a problem with the following. The field 'variant' locks in my
Delphi program after I use this trigger with a TIBDataset component, then
switch and use a DBEdit field to make another change. Is it the trigger or
the component that hangs the field? How to tell?? It only lets go if I
completely close the program, not just commit everything. Other field
triggers (designation) work ok, which makes me suspect the procedure.
CREATE TRIGGER CHNG_VARS FOR DESIGNATION ACTIVE BEFORE UPDATE POSITION 1 AS
BEGIN
if (new.variant<>old.variant)then
if (old.nl2>0 and old.nl3=0) then
begin
execute procedure
change_svar(old.cl1,old.designation,old.variant,new.variant);
end /*master variant changes*/
END
CREATE PROCEDURE CHANGE_SVAR (
CL1M SmallInt,
DESIG VarChar(100),
DESIGVARPRE VarChar(100),
DESIGVARPOST VarChar(100))
AS
declare variable id integer;
declare variable nl3 integer;
BEGIN
for
select desig_recno, nl3 from designation
where designation=:DESIG and variant=:Desigvarpre and cl1=:cl1m
into :ID,:nl3
do
begin
if (:nl3>0) then
begin
update designation
set variant=:Desigvarpost,
designation.ldate='now',
designation.luser='procCV'
where desig_recno=:id;
end /*if (:nl3>0) then*/
end /*for select do */
END
[Non-text portions of this message have been removed]