RefreshRecord problem
RefreshRecord problem
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.
p. s: Using Refresh methord is OK but not fitting to my need.
Re: RefreshRecord problem
"TO_CHAR('TDATE','YYYY')".
Are quotes around TDATE just a typo?
Are quotes around TDATE just a typo?
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
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