Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: pl/sql to validate email addresses

Re: pl/sql to validate email addresses

From: mgumbs <mgumbsNOmgSPAM_at_hotmail.com.invalid>
Date: Fri, 19 Nov 1999 05:39:52 -0800
Message-ID: <11f733ec.7cad4017@usw-ex0102-010.remarq.com>


I haven't got sql*plus in front of me at the mo to test this so the following could be a bit ropey! (I can't remember the order of parameters of the replace command, i think its right).

We can assume that an email address shouldn't have spaces or 2 @ signs. Returns TRUE if the address is valid.

Function Validate_Email(vEmailAddress in varchar2) return boolean is

  vBeforeLength number := 0;
  vAfterLength number := 0;

begin

  vBeforeLength := length(vEmailAddress);

  vAfterLength := length(replace(vEmailAddress, '@@',''));   if vBeforeLength = vAfterLength then

     return FALSE;
  end if;

end;

In article <3835477A.46C9E60D_at_sheffield.ac.uk>, j.m.whitehead_at_sheffield.ac.uk wrote:
> Does anybody know where I can get a pl/sql routine that will
> validate an
> entered email address? For example if somebody enters
> xyz_at_xyz.com
> it will accept it as valid but:
> xyz @ xyz . com
> wouldn't be accepted as valid. The validation doesn't need to be
> sophisticated just something that makes it hard for a user to
> enter a
> value that could never be a valid email address.
> TIA,
> Jon.

Received on Fri Nov 19 1999 - 07:39:52 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US