Subject Re: [ib-support] Converting Interbase to Firebird
Author Doug Pomerenke
On Sun, 2003-05-04 at 21:47, Helen Borrie wrote:
> At 09:34 PM 4/05/2003 -0500, you wrote:
> >Where I work we are using Interbase 7 with Delphi for a commercial
> >product.


> I get 'Dynamic SQL Error
> >expression evaluation not supported.'
> >
> >Any ideas on what's wrong?
>
> It's impossible to analyse without the exact text of the DDL that is
> failing. Post the DDL.
>
> heLen
>
Here's one of the blocks that gives this error. I did some mangling of
the variable names in order to protect our clients product.



ALTER PROCEDURE PROC_CHECK_XXX
(
CONTROL_XXX INTEGER,
XXX_ID INTEGER,
READDATE TIMESTAMP,
XXX_VALUE FLOAT,
HIGHLIMIT FLOAT,
LOWLIMIT FLOAT,
CURR_TIME TIMESTAMP
)
AS

DECLARE VARIABLE SourceNumber varchar(65);
DECLARE VARIABLE TrendInterval int;
DECLARE VARIABLE AvgXXX_VALUE float;

BEGIN

IF ((XXX_VALUE > HighLimit) OR (XXX_VALUE < LowLimit)) THEN
BEGIN

SELECT TrendInterval
FROM Sensor WHERE XXX_ID = :XXX_ID INTO :TrendInterval;

IF (TrendInterval > 0) THEN
BEGIN
SELECT
AVG(XXX_VALUE)
FROM
SensorLog
WHERE
XXX_ID = :XXX_ID AND
CONTROL_XXX = :CONTROL_XXX AND
LogDate BETWEEN (:Curr_Time - (((1/24) / 60) *
:TrendInterval)) AND :Curr_Time
INTO :AvgXXX_VALUE;
END


IF ((AvgXXX_VALUE > HighLimit) OR (AvgXXX_VALUE < LowLimit))
THEN
BEGIN
SELECT SourceNumber FROM Sensor WHERE XXX_ID = :XXX_ID INTO
:SourceNumber;
EXECUTE PROCEDURE PROC_InsAlarm (:SourceNumber, :CONTROL_XXX,
:ReadDate, :HighLimit, :LowLimit, :XXX_VALUE);
UPDATE ControlPoint SET AlarmState = 1 WHERE CONTROL_XXX =
:CONTROL_XXX;
POST_EVENT 'Rebuild_xxx';
END
END

END
;



--
Doug Pomerenke <djp@...>