Page 1 of 1

Update keys in Views + RefreshRecord

Posted: Thu 22 Sep 2005 14:26
by Frenk
Hi,
after a testing of SDAC demo I also found out that when joining tables and views or nesting tables in a select statement, Key fields are not found.
i.e.:
Ident = Identity field

select a.Ident, a.desc from items a -- works OK

select a.Ident, a.Desc, B.ItemSUM from items A
left join V_Stock B on a.Ident = B.Ident -- doesn't find key anymore on (Generate SQL tab)

What does refreshrecord actually do? If I have a "constrainted" select query and after inserting a record Refreshrecord is called, I get an error "Record changed by another user".
i.e.:
select * from items where Type = 1

insert item with Type = 2(!) and then after a call to RefreshRecord error occours "Record changed by another user"). If I understand correctly, It should refresh record using Refresh SQL statement in UpdateSQLs. Is there something else that must be set?

Frenk

Posted: Fri 23 Sep 2005 07:42
by Ikar
The problem is that SQL Generator doesn't allow to process complex queries. At that case you have to write SQLRefresh manually. As alternative, use WHERE clause instead of JOIN.