CREATE PROCEDURE "SE_DEV"."DEMO_WITH_SIGNAL_EXCEPTION" (
IN emai_id nvarchar(50),
OUT display_message nvarchar(300) )
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER /* you can set it as DEFINER */
AS
BEGIN
/* Declaration of Exit Handler */
DECLARE SIG_HANDLER CONDITION FOR SQL_ERROR_CODE 12001;
DECLARE EXIT HANDLER FOR SIG_HANDLER
BEGIN
display_message := 'Error Code ' || ::SQL_ERROR_CODE || ' ' || ::SQL_ERROR_MESSAGE;
END;
/* Declaration End */
IF :emai_id <> '' AND :emai_id NOT LIKE '_%@__%.__%' THEN
SIGNAL SIG_HANDLER SET MESSAGE_TEXT = 'Not an Email id';
END if;
display_message := 'Vaild Email Id';
END;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 |