Solved

Simple Trigger to Send Email

Posted on 2004-09-07
4
1,839 Views
Last Modified: 2006-11-17
Is there an easy way to create a simple trigger in a Sybase ASA DB that when there is an INSERT on table X, a simple message is emailed to an address?

Thanks!
-Matt
0
Comment
Question by:mfarley
  • 3
4 Comments
 
LVL 14

Expert Comment

by:Jan_Franek
Comment Utility
Yes, if your server runs on Windows OS. Use xp_sendmail system extended procedure - see http://manuals.sybase.com/onlinebooks/group-as/asg1251e/sprocs for detailed info about parameters. And you need to set up Sybase to use mail - see http://manuals.sybase.com/onlinebooks/group-as/asp1250e/ntconfig.

If you are not on Windows, it's harder - you can write your own extended procedure in C to send mail or you can write an application that will fetch data from some table and sends mail based on fetched data.
0
 
LVL 14

Expert Comment

by:Jan_Franek
Comment Utility
Oooops sorry, I overlooked, that you are on ASA - my post is about ASE.
0
 
LVL 14

Accepted Solution

by:
Jan_Franek earned 250 total points
Comment Utility
However, it seems like xp_sendmail exists in ASA as well (see ASA SQL reference / System objects / System procedures / System extended procedures - page 797 for version 9.0) and as it works with SMTP as well, you can probably use it even if you are not on Windows.
0
 

Author Comment

by:mfarley
Comment Utility
Jan,

I just setup a test trigger that emails me exactly how I want it to -- Thanks to your help!

-Matt
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now