Re: Exception Handling in Stored Proc's
Posted in 1998
Let's hope I understand your problem.
Try this:
BEGIN
ON EXCEPTION IN (-310)
END EXCEPTION WITH RESUME;
DROP TABLE dah;END;
SELECT x, y, z
INTO TEMP dah WITH NO LOG;
Hope it helps,
Octav
Shew Leong wrote:
>Hi,
>
>Can someone explain how ON EXCEPTION works in stored proc's. If you have
>sample code, it would be much appreciated.
>
>I'm trying to trap table already exist - error number -310. If the table
>exist
>then I want to drop it.
>
>Here's the code I've tried (syntax is off the top of my head):
>
>BEGIN
> ON EXCEPTION IN (-310)
> DROP TABLE tempMan
> END EXCEPTION WITH RESUME>
> BEGIN
> SELECT x, y, z
> INTO TEMP dah
> WITH NO LOG
> END
>END
>END>
>Thanks
>
>
--
Octav Chiriac Phone: (373) 2 21 20 96
NetInfo S.R.L. Fax: (373) 2 21 36 59
Chisinau (373) 2 24 00 83
Moldova, Republic of mailto:com@netinfo-moldova.com