Re: Question regarding databases..



In article <1132335666.112663.56030@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
<burak@xxxxxxxxxxx> wrote:

> Hello,
>
> I wasn't sure if this should go in this usenet or in something like
> Perl.DBI.etc, so I apologize if this is in the wrong place.
>
> Pretty simple question. I would like to create a Perl shell script
> that actively monitors a table in a database. Let's exemplify this
> before i go any further...

[further description snipped]

>
> That's the idea... the only problem is, I don't know how to make this
> database connection "live," ie I don't know how to write a program that
> just sits there running, looking for changes in a database, without
> ever terminating (unless by command).
>
> Any ideas? Your help is more than greatly appreciated.

You can use the sleep statement in your Perl program to have your
program periodically wake up and check the database table to see if
anything has changed. You can make the period whatever you like, in
multiples of 1 second. However, that is not the most efficient
solution, because your program might be doing a lot of checking with
nothing to do.

A better solution involves having some mechanism to activate your
program when there is something to do. The simplest way is to just
execute it -- however this involves some program activation and
database connection delays. A better solution is for your program to
start execution, connect to the database, and then wait for some event
to occur. There are several such mechanisms, depending upon your
platform. These include, for Unix at least, signals, shared memory,
I/O, semaphores, mutexes, etc. See 'perldoc perlipc' for more
information.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
.



Relevant Pages

  • Re: International Conference on the Phaistos Disk
    ... Usenet access had been seeing all along.- ... If your ISP offers NNTP service ... You could ping the various ports to see if they answer or you could ... direct access to Usenet database at all. ...
    (sci.lang)
  • Re: Looking for one GUI program for both email and news
    ... A database and/or client ... Why would you keep an "address book" for news? ... Usenet, so automated retrieval of e-mail addresses from Usenet postings ... message headers play a larger role on Usenet (X-No-Archive, X-No-Ahbou, ...
    (comp.os.linux.misc)
  • Re: International Conference on the Phaistos Disk
    ... of the scientific community as a whole is being hold up. ... Usenet access had been seeing all along.- ... If your ISP offers NNTP service ... accessible on your ISP's database from where they get distributed ...
    (sci.lang)
  • Re: International Conference on the Phaistos Disk
    ... of the scientific community as a whole is being hold up. ... Usenet itself. ... If your ISP offers NNTP service ... accessible on your ISP's database from where they get distributed ...
    (sci.lang)
  • Re: Cross-database execution permissions with certificates and sch
    ... activated user cannot access objects in other schemas in this database. ... injection is defended against, however, the threat exists anywhere EXECUTE ... CREATE USER dispatcher ... the certificate is a trusted authenticator because you granted AUTHENTICATE ...
    (microsoft.public.sqlserver.security)