|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Email Validation
Hai,
I need to validate the string for the Email entered in a text box in Oracle Forms. If any of you have any standard function please do let me know. Thanks & Regards, A.Mohammed Rafi. |
|
#2
|
|||
|
|||
|
You have to create an external procedure.
There usually is no way to validate an email address using smtp protocol, anyway. If you are on a windows box in a WAN, exchange can validate local email addresses for you. On unix this means: writing a simple piece of C Code:
int check_mail(char *recipient){
// system specific code goes here
return 0; // if okay
return 1; // if failure
}
compile the code into a shared library, eg: $ORACLE_HOME/libmymail.so create a shared library Oracle can call with extproc: Code:
CREATE OR REPLACE LIBRARY mail_utl_l as '/oracle/local/lib/libmymail.so'; create a package Code:
CREATE OR REPLACE PACKAGE mymail
IS
FUNCTION
check_mail( recipient IN VARCHAR2 DEFAULT NULL)
RETURN PLS_INTEGER;
Now you can call the package function on the server from forms. Also, for general mail try using the package UTL_SMTP, which can send mail and receive for you. There is no validation routine for mail recipients. |
|
#3
|
|||
|
|||
|
Use instr function
to validate ur e-mail u have to make sure that ur text contai ns @ and . and @ comes before .
so u can do the following " trigger when validate item " declere v_at number; v_dot number; begin v_at := instr(:email_text , '@') ; v_dot := instr(:email_text , '.'); if v_at = 0 or v_dot= 0 or v_at > v_dot then -- alert with not valied message end if; end; |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Email Validation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|