tags:

views:

238

answers:

2

Team,

I have scenerio where in i need to send an email from my stored procedure in DB2.

However i have not been able to figure out any so far, apart from using Task Center or Query Patroller. Can any one suggest me some pointers to this? I do not want to do it from any other language though.

Thanks, Harveer

A: 

There is nothing built-in in DB2 to do that, like xp_sendmail in SQL Server.

You have to write your stored procedure in one of the hosted languages (Java, C++) and then use an API from that language to send the mail.

See this article on how to do it using Java.

Michael Sharek
+1  A: 

With 9.7, you can use the UTL_MAIL or UTL_SMTP built-in packages.

korry
Thanks...did not know about that
Michael Sharek