SQL Generator doesn't want to update VIEW
Posted: Wed 16 May 2012 13:16
Hi.
Delphi XE 15.0.3953.35171
sDAC 6.1.6
There is a View, which contains a calculated field with trigger Instead of (upd, ins, del).
TMsStoreProc selects data from the View. For example,
Field "c" is calculated field.
I want to edit all three fields (a,b,c). But the SQL generator in TMsStoreProc ignores calculated field "c", as if it didn’t change (doesn't see this field) ..
Option UpdateALLFields makes update all fields ... but not calculated field! At design time Sql generator doesn't see this field in the key fields list.
If I create all fields at design time (FieldEditor->Create all fields) then the calculated field is created with the option ReadOnly = true. And changing field property ReadOnly to false or TMsStoreProc option SetFieldsReadOnly to false also doesn’t help.
I found only one solution. I have to set valid sql queries to the SQLInsert/SQLUpdate properties. Everything is OK. Calculated field is updated in right way. But it's not convenient to generate queries manually...
Delphi XE 15.0.3953.35171
sDAC 6.1.6
There is a View, which contains a calculated field with trigger Instead of (upd, ins, del).
TMsStoreProc selects data from the View. For example,
Code: Select all
Select id, a, b, c from View where id = 12.
I want to edit all three fields (a,b,c). But the SQL generator in TMsStoreProc ignores calculated field "c", as if it didn’t change (doesn't see this field) ..
Option UpdateALLFields makes update all fields ... but not calculated field! At design time Sql generator doesn't see this field in the key fields list.
If I create all fields at design time (FieldEditor->Create all fields) then the calculated field is created with the option ReadOnly = true. And changing field property ReadOnly to false or TMsStoreProc option SetFieldsReadOnly to false also doesn’t help.
I found only one solution. I have to set valid sql queries to the SQLInsert/SQLUpdate properties. Everything is OK. Calculated field is updated in right way. But it's not convenient to generate queries manually...
