You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by Apache Wiki <wi...@apache.org> on 2006/01/13 05:14:09 UTC
[Db-derby Wiki] Trivial Update of "SendEmailRoutine" by DanDebrunner
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.
The following page has been changed by DanDebrunner:
http://wiki.apache.org/db-derby/SendEmailRoutine
------------------------------------------------------------------------------
BODY VARCHAR(32000))
LANGUAGE JAVA PARAMETER STYLE JAVA
NO SQL
- EXTERNAL NAME 'testing.MailTest';
+ EXTERNAL NAME 'testing.MailTest.sendSMTP';
CREATE FUNCTION SEND_MAIL(
TO_ADDRESS VARCHAR(320),
@@ -125, +125 @@
{{{
-- Use the procedure, passing in the content from the application.
- CALL SEND_MAIL('fred@yahoo.com', 'Special Offer', ?);
+ CALL SEND_MAIL('fred@yahoo.com', 'Special Offer', ?)
-- Send an e-mail customers in good standing with a special
-- offer based upon the customer type.
select SEND_MAIL(c.email, 'Special Offer!!', M.email_text)
FROM CUSTOMERS C, MAILINGS M
- WHERE C.BALANCE > 1000.0 AND C.TYPE = M.CUST_TYPE AND M.OFFER_TYPE = 'special';
+ WHERE C.BALANCE > 1000.0 AND C.TYPE = M.CUST_TYPE AND M.OFFER_TYPE = 'special'
}}}
{{{
@@ -142, +142 @@
MODE DB2SQL
SELECT SEND_MAIL(c.email, 'Welcome to AcmeWidgets', M.email_text)
FROM newtab C, MAILINGS M
- WHERE C.TYPE = M.CUST_TYPE AND M.OFFER_TYPE = 'welcome';
+ WHERE C.TYPE = M.CUST_TYPE AND M.OFFER_TYPE = 'welcome'
}}}