Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Alerting SQL srvr from Web Post

Options
  • 22-02-1999 5:42pm
    #1
    Closed Accounts Posts: 192 ✭✭


    Yo, EWJ any idea's on how top post from a web page and get the submission to a SQL server to alert an admin to to something i.e. sort of like a Web Pager.

    By the way Jim, I think you're a really cool guy - in fact I'd have to say that you're my hero!! Not only are you amazing looking - but smart and witty too!!

    Clamor.

    [This message has been edited by earthworm_jim (edited 03-03-99).]


Comments

  • Closed Accounts Posts: 225 ✭✭earthworm_jim


    Hi clamor,

    basically, you can do it at the application level, or the database level.

    1. Application level:
    Whatever program you use to shove the query into the database could probably also set off the piece of software you want to do the pageing. Taking a simple example - if the paging is something like a simple email to an admin, I'd stick a couple of lines like this:

    $mailprog = '/usr/bin/sendmail';
    open (MAIL, "|$mailprog clamor@intel.com");
    print MAIL "Subject: Notification of Query\n";
    print MAIL "SQL FORM SUBMITTED!!!";
    print MAIL "$sqlstring";

    That's if you're using Perl 5 as your middleware. Just change mailprog to whatever your paging software is and adapt the parameters accordingly.

    If you're using for e.g. Cold Fusion or ASP, the syntax for shelling to the server is different - afaik, it's still possible in either case.

    2. Database level
    Have you heard of triggers? It's basically a technique used in databases to fire off a stored procedure is a dataset is changed in a specified way - e.g. if data is input in certain fields from the web. Basically it is a way of writing programs on the database and telling the db server "only run this program if a new entry goes in to the visitors table"

    You could easily set up a trigger on the database server to page or email someone if the event can detected by changes in the database raw data (in fact, even a select query can set off a trigger).

    Read the manuals for whatever database/middleware you have to work out the details. :P


  • Closed Accounts Posts: 192 ✭✭Clamor


    Triggers sound the best for the problem as the app still has to carry out changes at the db level.


Advertisement