<-----Google Analytics Code Start----> <-----Google Analytics Code Close---->
Skip to content

Green

color

Default screen resolution  Wide screen resolution  Increase font size  Decrease font size  Default font size  Skip to content Default color Pink color Green color Green color
This website has now moved to http://apps2fusion.com





Validate Email PL/SQL | Print |  E-mail
Written by Anil Passi   
Tuesday, 09 January 2007
Oracle delivers an API in EBS that can validate Email Address Format.
However it does not capture the invalidity if Email String were to be say xxx@host
You may use the below pl/sql function for Email Address Validation.


CREATE OR REPLACE FUNCTION xx_check_email(l_user_name IN VARCHAR2)
  RETURN VARCHAR2 IS
  l_dot_pos    NUMBER;
  l_at_pos     NUMBER;
  l_str_length NUMBER;
BEGIN
  l_dot_pos    := instr(l_user_name
                       ,'.');
  l_at_pos     := instr(l_user_name
                       ,'@');
  l_str_length := length(l_user_name);
  IF ((l_dot_pos = 0) OR (l_at_pos = 0) OR (l_dot_pos = l_at_pos + 1) OR
     (l_at_pos = 1) OR (l_at_pos = l_str_length) OR
     (l_dot_pos = l_str_length))
  THEN
    RETURN 'FAILURE';
  END IF;
  IF instr(substr(l_user_name
                 ,l_at_pos)
          ,'.') = 0
  THEN
    RETURN 'FAILURE';
  END IF;
  RETURN 'SUCCESS';
END xx_check_email;


Comments (2)add
...
written by kalyan , August 21, 2007
Its really helping.
oracle
written by ramu , February 01, 2008
what is the meaning of hwm(high watermask) in oracle?
You must be logged in to a comment. Please register if you do not have an account yet.

busy