Subject Stored procedure RDB$PROCEDURE_PARAMETERS error
Author Alan J Davies
Hi
I am using RC1 with W2000 and have no major problems with stored procedures
and use them a lot. This particular one has caused a problem, however, and
will not compile after closing and restarting the server.
The error is:-

Unsuccessful metadata update
STORE RDB$PROCEDURE_PARAMETERS failed
attempt to store duplicate value (visible to active transactions) in unique
index "RDB$INDEX_18"
Statement: CREATE PROCEDURE SP_EventLog

The procedure is:-

COMMIT WORK;
SET AUTODDL OFF;
SET TERM ^ ;

/* Stored procedures */

CREATE PROCEDURE SP_EventLog
(
Tag_No CHAR(20),
EventType smallint
)
RETURNS
(
HI_LO CHAR(10),
EVENT_DATE TIMESTAMP,
EVENT_TIME CHAR(8),
TAG_NO CHAR(20),
TAG_NAME CHAR(30),
CONDITION CHAR(11),
CONDITIONSP CHAR(11),
UNITS CHAR(7),
ALARMCONDITION CHAR(3),
ALARMGROUP CHAR(3),
SEQUENCE_NO INTEGER
)
AS
begin
if (:EventType=0) then
begin
for select
Hi_Lo,Event_Date,Event_Time,Tag_No,Tag_Name,Condition,ConditionSp,
Units,AlarmCondition,AlarmGroup,Sequence_No
From EventLog
Where Tag_No=:Tag_No
into

:Hi_Lo,:Event_Date,:Event_Time,:Tag_No,:Tag_Name,:Condition,:ConditionSp,
:Units,:AlarmCondition,:AlarmGroup,:Sequence_No
do
begin
suspend;
end
end
else if (:EventType=1) then
begin
for select
Hi_Lo,Event_Date,Event_Time,Tag_No,Tag_Name,Condition,ConditionSp,
Units,AlarmCondition,AlarmGroup,Sequence_No
From EventLog
Where Tag_No=:Tag_No
And Hi_Lo not containing 'AL'
into

:Hi_Lo,:Event_Date,:Event_Time,:Tag_No,:Tag_Name,:Condition,:ConditionSp,
:Units,:AlarmCondition,:AlarmGroup,:Sequence_No
do
begin
suspend;
end
end
else if (:EventType=2) then
begin
for select
Hi_Lo,Event_Date,Event_Time,Tag_No,Tag_Name,Condition,ConditionSp,
Units,AlarmCondition,AlarmGroup,Sequence_No
From EventLog
Where Tag_No=:Tag_No
And Hi_Lo containing 'AL'
into

:Hi_Lo,:Event_Date,:Event_Time,:Tag_No,:Tag_Name,:Condition,:ConditionSp,
:Units,:AlarmCondition,:AlarmGroup,:Sequence_No
do
begin
suspend;
end
end
end
^

SET TERM ; ^
COMMIT WORK;
SET AUTODDL ON;


Regards
Alan Davies