Server Side DataChange

Forum related to PostgreSQL

Moderators: gto, cipto_kh, EgonHugeist, olehs

Post Reply
sfxcc
Senior Boarder
Senior Boarder
Posts: 95
Joined: 13.05.2010, 18:48

Server Side DataChange

Post by sfxcc »

When we post a record and some fields are changed on server side it doesnt change the zeos dataset, we need to refresh the table which will force a dataset cursor pos change etc. not User friendly.


So there is any way to refresh only the updated/inserted row ?
where's the code ..
enix
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 02.02.2012, 22:55

Post by enix »

Yes. Use ZUpdateSQL assigned to ZQuery as UpdateObject.
Set ZUpdateSQL.RefreshSQL statetment that select current reccord, for example:
SELECT * FROM table WHERE PrimaryKeyID=:PrimaryKeyID
After post reccord You can refresh it by: ZQuery1.RefreshCurrentRow(true)

reg. Enix
sfxcc
Senior Boarder
Senior Boarder
Posts: 95
Joined: 13.05.2010, 18:48

Post by sfxcc »

Thanks enix, ill try it out.

:)
where's the code ..
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

sfxcc,

Did this work as expected?

Mark
Image
sfxcc
Senior Boarder
Senior Boarder
Posts: 95
Joined: 13.05.2010, 18:48

Post by sfxcc »

I think its to weird the way this workd, if we do Refreshsql:= select * from table where akey=avalue it refresh the current record , but if no where it will refresh all table and move the cursor to first pos ....


Can it be possible no cursor pos move and refresh only all result of query ex: where field >= number
where's the code ..
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

sfxcc,

This would be an extremely difficult feature to implement as it involves evaluating the results you get from this refresh query and guess if the record is already in the dataset (and which record is it then?) or if it should be appended at the end of the dataset. So no... it's not a feature we can afford to add and maintain.
But nothing keeps you from refreshing the dataset and repositioning the cursor at the curent record.

Mark
Image
markus
Senior Boarder
Senior Boarder
Posts: 58
Joined: 17.10.2011, 12:43
Location: Piotrków Trybunalski, Poland

Post by markus »

To add more - i think its almost impossible to refresh all updated records (but only them) for one big reason: trigger functions - they can change almost everything in DB.
Post Reply