Thread: Monitoring new records

Monitoring new records

From
messias
Date:
Hello



I am new in SQL programing and I have a problem. I would like to

monitor the new records which is inserted into an SQL table.

I found some solution which mentioned a queue (log) table which can

be filled by a trigger. The client would read from that queue table,

and delete the readed data.

I think this solution can work with only one client.

But I would have more than one client at the same time, and I do not

know how I can delete the data from the queue table.

I can make queue table for every client, but I think this is not a

nice solution.

I am affraid of lost client....

I am intrested in every solution which can solve my problem.



Any help would is appreciated.



Thanks Ferenc Banhidi



Re: Monitoring new records

From
"Andrej Ricnik-Bay"
Date:
On 29/02/2008, messias <messias@fw.hu> wrote:
>  be filled by a trigger. The client would read from that queue table,
>  and delete the readed data.


>  I think this solution can work with only one client.
I guess it depends on how you define "client"  .... also: what is the
background of several "clients" monitoring, what are you looking
for, what happens if you delete the new records e.g. based on
time rather than "having been viewed"?


Cheers,
Andrej


--
Please don't top post, and don't use HTML e-Mail :}  Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm

Re: Re: Monitoring new records

From
messias
Date:
--- Andrej Ricnik-Bay <andrej.groups@gmail.com> wrote (2008.02.29
00:38:30): ---



> On 29/02/2008, messias <messias@fw.hu> wrote:

> >  be filled by a trigger. The client would read from that queue
table,

> >  and delete the readed data.

>

>

> >  I think this solution can work with only one client.

> I guess it depends on how you define "client"



My clients would be a C++ application, and they have to monitor an

event table. The events are comming from for example a fire alarm

system.



>  .... also: what is the

> background of several "clients" monitoring, what are you looking

> for,

I want to show the new events (records) so I am instrested in only
inserting.



what happens if you delete the new records e.g. based on

> time rather than "having been viewed"?

>

I am not sure that I understand your question. When the new records
were deleted from the table I would do nothing.

If I had only one client, I would make 2 table for the events. One
would store the events and an other would be the queue (log). The
data collectors would insert their data into the first (event) table,
and a trigger or a rule forward they into the queue and send a
notification. If my client got a notification, it would read the new
datas, and than delete them.

But as I mentioned I would have more than one client at the same
time, so I do not know when and who can delete the data from the
queue table.



> Cheers,

> Andrej

>



Thanks Ferenc





Re: Monitoring new records

From
"Sean Davis"
Date:
2008/2/29 messias <messias@fw.hu>:
> --- Andrej Ricnik-Bay <andrej.groups@gmail.com> wrote (2008.02.29
>  00:38:30): ---
>
>
>
>
>  > On 29/02/2008, messias <messias@fw.hu> wrote:
>
>  > >  be filled by a trigger. The client would read from that queue
>  table,
>
>  > >  and delete the readed data.
>
>  >
>
>  >
>
>  > >  I think this solution can work with only one client.
>
>  > I guess it depends on how you define "client"
>
>
>
>  My clients would be a C++ application, and they have to monitor an
>
>  event table. The events are comming from for example a fire alarm
>
>  system.

Then, you probably want to look at the LISTEN...NOTIFY system.  Check
the documentation for more details.

Sean