Page 1 of 1

RefreshRecord problem

Posted: Thu 17 Aug 2006 10:20
by yeah_xxc
I use the SmartQuery->Append,...,SmartQuery->Post method to insert a record including field named "TDATE", and get the record with additional field "TO_CHAR('TDATE','YYYY')". Problem happens while "TDATE" is refreshed but "TO_CHAR('TDATE','YYYY')" is still "".After RefreshRecord is used, it doesn't work.

p. s: Using Refresh methord is OK but not fitting to my need.

Re: RefreshRecord problem

Posted: Thu 17 Aug 2006 14:08
by Don Horn
"TO_CHAR('TDATE','YYYY')".

Are quotes around TDATE just a typo?

Posted: Fri 18 Aug 2006 07:13
by yeah_xxc
yah! just typo! And then?

Posted: Fri 18 Aug 2006 09:02
by Plash
To make the RefreshRecord method refresh the field TO_CHAR(TDATE,'YYYY') you should set SQLRefresh property of TSmartQuery. For example, if your table primary key is named as 'ID' then assign such a string to SQLRefresh property:

Code: Select all

WHERE ID = :ID

Posted: Fri 18 Aug 2006 09:53
by yeah_xxc
I got this "Refresh failed, found 0 record", but the record really exists when I use oraExplorer to check it out.

Posted: Sat 19 Aug 2006 02:46
by yeah_xxc
??????

Posted: Mon 21 Aug 2006 09:26
by Plash
Please provide us values of SQL and SQLRefresh properties that you have assigned for SmartQuery.

Posted: Tue 22 Aug 2006 11:38
by yeah_xxc
The SQL contains "WHERE ID Refresh().

Posted: Wed 23 Aug 2006 12:44
by Plash
In this case you need to assign to SQLRefresh property full SELECT statement. This statement should be the same as in SQL property but instead of "WHERE ID < 5" write "WHERE ID = :ID". For example:

Code: Select all

SELECT *, TO_CHAR(TDATE,'YYYY') FROM Table1
WHERE ID = :ID

Posted: Thu 24 Aug 2006 11:39
by yeah_xxc
It works!
Thanks very much!