Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1958
  • Last Modified:

Simple Trigger to Send Email

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
mfarley
Asked:
mfarley
  • 3
1 Solution
 
Jan FranekCommented:
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
 
Jan FranekCommented:
Oooops sorry, I overlooked, that you are on ASA - my post is about ASE.
0
 
Jan FranekCommented:
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
 
mfarleyAuthor Commented:
Jan,

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

-Matt
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now