Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Alerting SQL srvr from Web Post

  • 22-02-1999 04: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