RefreshRecord problem

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
yeah_xxc
Posts: 7
Joined: Sat 12 Aug 2006 14:41

RefreshRecord problem

Post by yeah_xxc » Thu 17 Aug 2006 10:20

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.

Don Horn
Posts: 6
Joined: Sat 12 Aug 2006 21:08
Location: Atlanta, GA

Re: RefreshRecord problem

Post by Don Horn » Thu 17 Aug 2006 14:08

"TO_CHAR('TDATE','YYYY')".

Are quotes around TDATE just a typo?

yeah_xxc
Posts: 7
Joined: Sat 12 Aug 2006 14:41

Post by yeah_xxc » Fri 18 Aug 2006 07:13

yah! just typo! And then?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 18 Aug 2006 09:02

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

yeah_xxc
Posts: 7
Joined: Sat 12 Aug 2006 14:41

Post by yeah_xxc » Fri 18 Aug 2006 09:53

I got this "Refresh failed, found 0 record", but the record really exists when I use oraExplorer to check it out.

yeah_xxc
Posts: 7
Joined: Sat 12 Aug 2006 14:41

Post by yeah_xxc » Sat 19 Aug 2006 02:46

??????

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 21 Aug 2006 09:26

Please provide us values of SQL and SQLRefresh properties that you have assigned for SmartQuery.

yeah_xxc
Posts: 7
Joined: Sat 12 Aug 2006 14:41

Post by yeah_xxc » Tue 22 Aug 2006 11:38

The SQL contains "WHERE ID Refresh().

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 23 Aug 2006 12:44

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

yeah_xxc
Posts: 7
Joined: Sat 12 Aug 2006 14:41

Post by yeah_xxc » Thu 24 Aug 2006 11:39

It works!
Thanks very much!

Post Reply