Icon View Incident Report

Minor Minor
Reported By: Jim Garrity
Reported On: 1/26/2011
For: Version 2.05 Build 2
# 3373 EXECUTE IMMEDIATE USING Clause Not Allowing ERROR Functions in ERROR Triggers

Compiling the following trigger gives an error saying that functions are not allowed: ErrorCode

CREATE TRIGGER "LogInsertError" ERROR INSERT ON "Customer"
 WHEN LoadingUpdates ()

 Begin
 Execute Immediate 'INSERT INTO Load_Errors (?,?,?,?,?,?)' USING
 'Insert', Current_TimeStamp(), ErrorCode(), ErrorMsg(),
 NewRow.State, 'Appointment';
 End

Workaround:

CREATE TRIGGER "LogInsertError" ERROR INSERT ON "Customer"
 WHEN LoadingUpdates ()

 Begin
 declare Error_Code INTEGER DEFAULT ErrorCode();
 declare Error_Msg VARCHAR DEFAULT ErrorMsg();
 Execute Immediate 'INSERT INTO Load_Errors (?,?,?,?,?,?)' USING
 'Insert', Current_TimeStamp(), Error_Code, Error_Msg,
 NewRow.State, 'Appointment';
 End



Comments Comments and Workarounds
The workaround is to declare local variables for the ERRORCODE() and ERRORMSG() function calls, and pass them instead to the USING clause.


Resolution Resolution
Fixed Problem on 1/27/2011 in version 2.05 build 3


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB LCL Standard with Source
ElevateDB PHP Standard
ElevateDB PHP Standard with Source
ElevateDB PHP Trial
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image