Subject Re: [ib-support] Exception handling
Author Svein Erling Tysvaer
Swedish Phantom,
what surprises me is that you do this in a procedure and not in a before
insert/before update trigger.

Set

At 12:22 21.11.2002 +0000, you wrote:
>I have creatd the following store procedure:
>
>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;
>EXIT;
>END^
>SET TERM ; ^
>
>What i actually want to do is to control if the count on colum
>(PERSNR) > 20 then
>initiate a exception called SANGER displaying the following
>message 'No more beds'
>
>How should i change my current store procedure and also have the
>exception inside the stored procedure.