Page 1 of 1

Refreshing problems with OraQuery / DBGrid

Posted: Wed 30 Nov 2011 06:42
by Moehre
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

Posted: Wed 30 Nov 2011 08:40
by AlexP
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 .....';