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;
Halim, a Georgia Tech graduate Senior Database Engineer/Data Architect based in Atlanta, USA, is an Oracle OCP DBA and Developer, Certified Cloud Architect Professional, and OCI Autonomous Database Specialist. With extensive expertise in database design, configuration, tuning, capacity planning, RAC, DG, scripting, Python, APEX, and PL/SQL, he combines technical mastery with a passion for innovation. Notably, Halim secured 16th place worldwide in PL/SQL Challenge Cup Playoff on the year 2010.
Tuesday, March 16, 2010
Subscribe to:
Post Comments (Atom)
My Blog List
-
-
-
ASSM states3 weeks ago
-
UKOUG Discover 20241 month ago
-
-
-
-
-
-
-
-
Moving Sideways8 years ago
-
-
Upcoming Events...11 years 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