Hi to all, here it is :
create procedure
smart_group.sp_L_Check_For_Deletion(in nPTID integer)
reads sql data
language sql
begin
if exists(select * from smart_group.L_RequiredQuans as req join
smart_group.L_ReservedQuans as r on r.RequireID = req.id where
r.SOURCE_PTID = nPTID) then
raise_error('99999','some message here');
--signal sqlstate '99999',('some message here');
end if;
end
And here is the exception I receive :
SQL0104N An unexpected token "raise_error" was found following "_PTID = nPTID) then
". Expected tokens may include: "RETURN
I've tried switching between "raise_error" and "signal sqlstate" and I've tried different combinations of parameters in the declaration of the procedure. I have no clues what is going on. Any ideas?