Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


hi

sql gurus, here is my question 4 u.

i wanna use triggers for sending reminder mail to all users
who are registered to the site. if any one knws the code plz
send me ans here : chayabs3@gmail.com


thnx advance



hi sql gurus, here is my question 4 u. i wanna use triggers for sending reminder mail to all ..

Answer / gourvendra singh

Hi,

this can be done, i can not send u the exact code but
following steps can help you out.

-- Create a procedure with following code in mailhost you
have to enter the IP of the mail server :

CREATE OR REPLACE PROCEDURE LEAMIGR_BAFLAF.email(p_target
IN VARCHAR2, p_subj IN VARCHAR2, p_message IN VARCHAR2) IS
--PURPOSE: SEND p_message TO p_target VIA EMAIL.

v_eol VARCHAR2(2) := chr(13)||chr(10); -- EOL CHARACTERS
v_sender VARCHAR2(50) := 'sender@mail.com';
mailhost VARCHAR2(35) := 'mail@mail.com';
mail_connection utl_smtp.connection;

BEGIN
-- ESTABLISH CONNECTION AND PERFORM HANDSHAKING
mail_connection := utl_smtp.open_connection(mailhost,25);
utl_smtp.helo(mail_connection,mailhost);
utl_smtp.mail(mail_connection,v_sender);
utl_smtp.rcpt(mail_connection,p_target);

-- BUILD THE MAIL MESSAGE AND SEND IT OUT
utl_smtp.mail_connection
('Subj:'||p_subj||v_eol||v_eol||p_message||v_eol);

-- SEVER THE CONNECTION
utl_smtp.quit(mail_connection);

EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20002,'ERROR IN EMAIL
=> '||SQLCODE||':
'||SQLERRM);
END;

-- Now create a trigger on the table where the insert
operation is happining and on post insertion call the
procedure with the mail id of the user to whom you want to
send a mail.

I think this will work.

for any query can contact at:
raviindian2114@gmail.com

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

Is left join faster than inner join?

0 Answers  


What are triggers in sql?

0 Answers  


What are the steps for performance tuning.

0 Answers  


How can you load multi line records? : aql loader

0 Answers  


Compare SQL and PL/SQL.

3 Answers  


What are the differences between in and exists clause?

0 Answers  


Can we join tables without foreign key?

0 Answers  


what is self join and why is it required? : Sql dba

1 Answers  


What is native sql query?

0 Answers  


How is use pl and sql?

0 Answers  


What is implicit cursor in pl sql?

0 Answers  


Let us suppose we have a table with structure in order empno empname empdesig empcountry and now i want to re-organize the columns of this table to empno empdesig empname empcountry how can i do this with queries ? assume that table contains the data.

3 Answers  


Categories