RefreshRecord, Options.FullRefresh BUT not all Fields?

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dschuch
Posts: 75
Joined: Thu 05 Feb 2009 15:29
Location: Dresden

RefreshRecord, Options.FullRefresh BUT not all Fields?

Post by dschuch » Mon 05 Nov 2012 22:44

Hy, we have a very complex query. Its created in a way, the user can modify records. So after Post we need to RefreshRecord because of some Database Action.

The Problem:

We need to FullRefresh, because there are Functions in the Query that need to be refreshed.
BUT there are also Window-Funtions in the Query, e.g. (exakt content doesnt matter)

Code: Select all

CAST(row_number() OVER(PARTITION BY date_to_yearmonth(date)=date_to_yearmonth(COALESCE(ldate, date)) ORDER BY COALESCE(ldate, date), field1, pos1) AS INTEGER) AS row_number,
So refreshrecord kills our RowNumber, its clear: refreshRecord selects just one record, so the backend returns the result for 1 record.

Is there is a way to handle this? Can i explicit EXCLUDE fields from the RefreshRecord-Procedure on some way?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: RefreshRecord, Options.FullRefresh BUT not all Fields?

Post by AlexP » Tue 06 Nov 2012 14:28

hello,

Analytical functions compute values after retrieving all the query data, therefore, if in the query there is a WHERE section with limitation on record set, the values of an analytical function will be computed after the WHERE section is applied for the retrieved data. Therefore, in this case, you should explicitly call full Refresh, e.g. in the AfterPost event.

Post Reply