Subject | Re: [ib-support] Exception handling |
---|---|
Author | Regina Phandu |
Post date | 2002-11-21T12:44:31Z |
You have to create exception first, like this:
create exception sanger 'No more beds';
commit;
then inside the procedure you can called it: exception sanger
SET TERM ^ ;
CREATE PROCEDURE SANGPLATSER
(AVDID INTEGER, KON CHAR(1))
RETURNS
(TOTAL_SANGER CHAR(10))
AS
BEGIN
SELECT COUNT(PERSNR) FROM VY_SANGPLATSER
WHERE
AVDID = :AVDID
AND
KON = :KON
INTO :TOTAL_SANGER;
if (persnr > 20) then exception sanger;
EXIT;
END^
SET TERM ; ^
You can also read on DataDef.pdf about this. Hope it helps!
Regards,
Regina Phandu
create exception sanger 'No more beds';
commit;
then inside the procedure you can called it: exception sanger
SET TERM ^ ;
CREATE PROCEDURE SANGPLATSER
(AVDID INTEGER, KON CHAR(1))
RETURNS
(TOTAL_SANGER CHAR(10))
AS
BEGIN
SELECT COUNT(PERSNR) FROM VY_SANGPLATSER
WHERE
AVDID = :AVDID
AND
KON = :KON
INTO :TOTAL_SANGER;
if (persnr > 20) then exception sanger;
EXIT;
END^
SET TERM ; ^
You can also read on DataDef.pdf about this. Hope it helps!
Regards,
Regina Phandu