Skip to Content.
Sympa Menu

freetds - RE: [freetds] Freetds API query

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <ThompBil AT exchange.uk.ml.com>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Freetds API query
  • Date: Mon, 9 Jun 2003 18:38:45 +0100

Manoranjan,

I think you're going to have to design this functionality yourself.

First, you're going to need a mechanism to simplify the task of finding out
whether the table has been updated or not.
I would suggest a trigger on the table which inserts a row into another
table whenever any update, delete or insert happens. This second table could
be a single-column table and you could put a unique clustered index on that
column WITH IGNORE_DUP_KEY . That would prevent many rows being inserted
into the table. You'd just get one or none... a flag if you will.

next you need to design a program on the UNIX side, which will periodically
poll the second table looking for entries appearing. If you're not too
bothered about latency in your application, then you could have a 'sleep' in
your polling loop that would prevent you flooding the server with queries.
When you find a row in the 'trigger' table, you do what you have to do, then
delete it. then go back to polling again.

As james says, not pretty, not terribly efficient, but it will do the job
for you.

There may be a neater way to do this, it all depends on what you want to do
when this table changes.
What do you want to do ?

HTH,


Bill

> -----Original Message-----
> From: manoranjan_sahu AT agilent.com [SMTP:manoranjan_sahu AT agilent.com]
> Sent: Monday, June 09, 2003 5:14 PM
> To: freetds AT lists.ibiblio.org
> Subject: [freetds] Freetds API query
>
>
> Hello,
> I am using freetds with unixodbc to communicate with MS SQL server.
> Here is what I am trying to do.
>
> >From my unix system, my application needs to be notified of any
> change(insert, update, delete) to a table (say T1). Does freetds has any
> api I can use to do this task?
>
> Thanks,
> Manoranjan
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds





Archive powered by MHonArc 2.6.24.

Top of Page