UpdatingTable not functioning properly
Posted: Wed 26 Aug 2009 15:32
I asked the following question to support:
We have the following select statement (simplified):
select EC_ID, EC_Name, EC_FirstName, EC_Type from employeeContracts union
select EC_ID, EC_Name, EC_FirstName, EC_Type from OldEmployeeContracts
We now want to enable updates. I thought we could just put EmployeeContracts in UpdatingTable and it should be fine. As soon as we put that in there, nothing gets updated. If we use a UpdateSQL script it works but MSQuery generates a huge statement update statement and not only the values changed.
How can we accomplish this? BTW Only EmployeeContracts needs to be updatable, the one of the other table is readonly.
==============================
I got this reply:
This problem is connected with the peculiarity of the SQL Server work. For UNION query SQL Server doesn't return information about actual field names and about the table, to which the fields belong. Therefore you can not modify such result sets.
==============================
I don't understand this reply. Why would you need information about actual field names and about the table?
When the developer explicitly tells SDAC which table to update (in the UpdatingTable property) and which fields SDAC needs to check for changes are specified in the pfInUpdate flag of those fields.
Isn't that what the UpdatingTable field is for? Anyone else have these kind of problems?
We have the following select statement (simplified):
select EC_ID, EC_Name, EC_FirstName, EC_Type from employeeContracts union
select EC_ID, EC_Name, EC_FirstName, EC_Type from OldEmployeeContracts
We now want to enable updates. I thought we could just put EmployeeContracts in UpdatingTable and it should be fine. As soon as we put that in there, nothing gets updated. If we use a UpdateSQL script it works but MSQuery generates a huge statement update statement and not only the values changed.
How can we accomplish this? BTW Only EmployeeContracts needs to be updatable, the one of the other table is readonly.
==============================
I got this reply:
This problem is connected with the peculiarity of the SQL Server work. For UNION query SQL Server doesn't return information about actual field names and about the table, to which the fields belong. Therefore you can not modify such result sets.
==============================
I don't understand this reply. Why would you need information about actual field names and about the table?
When the developer explicitly tells SDAC which table to update (in the UpdatingTable property) and which fields SDAC needs to check for changes are specified in the pfInUpdate flag of those fields.
Isn't that what the UpdatingTable field is for? Anyone else have these kind of problems?