Refreshing problems with OraQuery / DBGrid

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Moehre
Posts: 42
Joined: Fri 11 Nov 2005 11:37

Refreshing problems with OraQuery / DBGrid

Post by Moehre » Wed 30 Nov 2011 06:42

Hi!

I am using ODAC 7.00.03 / Delphi 5 and connected an TOraQuery with TOraDataSource / TOraSession to a dbgrid component. There are some calculated values in the query like "CASH / DECODE(VAL1,NULL,1,0,1,VAL1)"

After entering a new value for "CASH" I want the query / dbgrid to refresh an re-calculate the result. I set the "Refresh Options" of the OraQuery to "afterUpdate" and "BeforeEdit"

With this properties no refresh of the calculated fields will be executed / displayed in the DBGRID. Now I played around with the other options and set the "FullRefresh" Option of the OraQuery to "true". After editing the cash value in the DBGRID I get an error message "Identifier too long" ?!

Whats going wrong here? Or is there another way to add a calculated field ti the OraQuery !! (not OraTable! I am selecting data from different tables, but only a few fields from one table are editable)

Thx in advance
Detlev

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

Post by AlexP » Wed 30 Nov 2011 08:40

Hello,

To make all fields refresh, including “countable” ones, after changing one field, you need to set the roAfterUpdate option to True and include “countable” fields into the query that is executed on refreshing, i.e. you should specify a query with the “countable” field in the OraQuery1.SQLRefresh.Text property, for example:

OraQuery1.SQLRefresh.Text := 'SELECT FIELD1, ... ,FIELDN, CASH / DECODE(VAL1,NULL,1,0,1,VAL1) FROM .....';

Post Reply