I am looking to patch an SQL table (SQL On-Prem Connector) that includes calculated columns.
The patch is successful, but throws an error saying that the calculated columns are read only and cannot be changed. This necessitates me filtering out any readonly errors (dangerous) and I also worry it slows performance of the patch statement.
This occurs even if the table of patches includes no Read-Only columns.
In the below example, CollectionPrePatch is a collection of the records to be modified, direct from the DB.
CollectionPostPatch is a collection of the records after modification, to be patched.
Patch(SQLTable, CollectionPrePatch, CollectionPostPatch)
Raises this error, which is expected.
But so does
Patch(SQLTable, CollectionPrePatch, DropColumns(CollectionPostPatch, CalculatedColumns))
And so does
ClearCollect(TempCollectionPostPatch, DropColumns(CollectionPostPatch, CalculatedColumns));
Patch(SQLTable, CollectionPrePatch, TempCollectionPostPatch)
I understand that some other members have avoided this error by directly specifying records in their patch statement, rather than a table of records, however there are many many columns in this table and they may be changed in future, so I would rather avoid such a manual workaround, where I have to type out every single column.