Subject | Re: Are before triggers absolutely reliable? What happens if they fail? |
---|---|
Author | rogervellacott |
Post date | 2007-10-29T14:49:53Z |
I would guess that your client app is inserting, then sometimes the
user edits and resaves. The edit is not rereading the record, so the
local DOC_CREATED_DATE field is null, and is overwriting the field in
the underlying record.
You could reread the record in the BeforeEdit event of your query
component.
Roger Vellacott
Passfield Data Systems Ltd
user edits and resaves. The edit is not rereading the record, so the
local DOC_CREATED_DATE field is null, and is overwriting the field in
the underlying record.
You could reread the record in the BeforeEdit event of your query
component.
Roger Vellacott
Passfield Data Systems Ltd
>the
> AS
> DECLARE VARIABLE v_Proj_FeeLumpSum NUMERIC(18,2);
> DECLARE VARIABLE v_doc_proj_name VARCHAR(140);
> DECLARE VARIABLE v_doc_proj_desref VARCHAR(12);
> DECLARE VARIABLE v_proj_feepercent FLOAT;
>
> BEGIN
> IF (NEW.DOC_ID IS NULL) THEN
> BEGIN
> NEW.DOC_ID = GEN_ID(GEN_DOC_ID,1);
> END
>
> NEW.DOC_CREATED_DATE = CURRENT_TIMESTAMP;
> NEW.DOC_ACTIVE = 'Y';
> NEW.DOC_SUPPL_INV_FREIGHT = 0;
>
> SELECT proj.proj_feelumpsum, proj_name, proj_desref, proj_feepcnt
> FROM proj
> WHERE proj.proj_id = NEW.proj_id
> INTO :v_Proj_FeeLumpSum, :v_doc_proj_name, :v_doc_proj_desref,
> :v_proj_feepercent;
>
> New.doc_proj_name = :v_doc_proj_name;
> new.doc_proj_desref = :v_doc_proj_desref;
> new.doc_proj_feepercent = :v_proj_feepercent;
> NEW.doc_proj_feelumpsum = :v_proj_feelumpsum;
>
> if (new.DOCTYPE_ID = 1) then -- rfq
> new.DOC_INSTRUCTION = 'Please quote for supply & delivery of
> following items:';
>
> if (new.DOCTYPE_ID = 3) then -- rfq
> new.DOC_INSTRUCTION = 'Please supply & deliver the following
> items:';
> END
>