Subject | Re: Exception handling |
---|---|
Author | fantomen66 |
Post date | 2002-11-21T15:20:21Z |
That helped.. pretty obvious i guess *s* thanks
brgds
sohail
brgds
sohail
--- In ib-support@y..., "Richard Pendered" <rpendered@t...> wrote:
> in the if line replace the 'persnr' with 'TOTAL_SANGER' and it
should work
>
> -----Original Message-----
> From: fantomen66 [mailto:sohail.hasware@h...]
> Sent: 21 November 2002 13:54
> To: ib-support@y...
> Subject: [ib-support] Re: Exception handling
>
>
> Hi Regina,
>
> I am sorry Regina, I tried to insert the if statement as you
> recomomended in your example, but I got the following error in
> interbase:
> Dynamic SQL Error
> SQL error code = -206
> Column unknown
>
> Strange enough though that if I discard the if statement there is
no
> problem. I had also created the exception itself before the stored
> procedure.
>
> brgds,
> sohail
>
>
> --- In ib-support@y..., "Regina Phandu" <regina@3...> wrote:
> > 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
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@e...
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/