checking valid email address
=======================================
CREATE OR REPLACE PROCEDURE EMAIL_CHECK(EMAIL_ID VARCHAR2)
AS
VALID NUMBER;
BEGIN
SELECT 1
INTO VALID
FROM
(SELECT EMAIL_ID FROM DUAL)
WHERE REGEXP_LIKE(EMAIL_ID,'.*\@.*\..*');
IF VALID = 1 THEN
DBMS_OUTPUT.PUT_LINE('EMAIL ID ' || EMAIL_ID || ' IS NOT VALID');
ELSE
DBMS_OUTPUT.PUT_LINE('EMAIL ID ' || EMAIL_ID || ' IS VALID');
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE('EMAIL ID ' || EMAIL_ID || ' IS NOT VALID');
END;
CREATE OR REPLACE PROCEDURE EMAIL_CHECK(EMAIL_ID VARCHAR2)
AS
BEGIN
IF OWA_PATTERN.MATCH(EMAIL_ID, '.*\@.*\..*')
THEN
DBMS_OUTPUT.PUT_LINE('Valid Email');
ELSE
DBMS_OUTPUT.PUT_LINE('InValid Email');
END IF;
END;
Everything Changes
2 weeks ago
5 comments:
Excellent !!!! The better solution in web... Congratulation Friend !!
very good solution thanks
Very good solution. Thank you
Nice Solution Sir..... Thanx!!!!
... INTO VALID
FROM
(SELECT EMAIL_ID FROM DUAL
WHERE REGEXP_LIKE(EMAIL_ID,'.*\@.*\..*')
);
...
because a bracket is put in bad place !
Post a Comment