Hi,
I apologize for my few experience in databases.
I've a this scenario over TCP-IP
Two remote win apps write records in the same MySQL table.
Another win app, called Myservice, have to read the changes in the same table.
My problem is how to retraive periodically the rows changed in the same table from Myservice.
I know well how to use timers for polling but i don't know a quick way to retraive data from the same table only when there are new or modified data.
Please could you provide me some code to help me.
Thx,
Best Regards,
Nunzio[/code]
Two App Write TO MySQL and Another Read FROM MySQL
-
- Posts: 19
- Joined: Fri 19 Nov 2004 18:51
- Location: South Italy
Re: Two App Write TO MySQL and Another Read FROM MySQL
There are several solutions for your applied problem.
You can add lastmodified filed of timestamp type into your table and when you insert or modify data you should enter a current date into this field.
When your service must select updated data, it can do it by condition lastmodified > lastprocesstime, where lastprocesstime is a last time of starting your process.
You can add lastmodified filed of timestamp type into your table and when you insert or modify data you should enter a current date into this field.
When your service must select updated data, it can do it by condition lastmodified > lastprocesstime, where lastprocesstime is a last time of starting your process.
-
- Posts: 19
- Joined: Fri 19 Nov 2004 18:51
- Location: South Italy
TimeStamp
I've setted a timestamp(20) Unique Not Null into a column in my table.
Now how can i set MySQLCommand to avoid update repetitions and get the lastet modified line?
Thx,
Nunzio
Now how can i set MySQLCommand to avoid update repetitions and get the lastet modified line?
Thx,
Nunzio