Overview
When using external object types with a connection to external database, you see an "Invalid column name " error when running a refresh for the object type. The error started to show after there was changes done to the external database, for example updating or removing the table columns.
…
ExternalDSHelper.h, xx, Statement(s) could not be prepared. (ERROR: 8180, SQLSTATE: 42000)(0x80040E14)
MCommand.h, xx, Statement(s) could not be prepared. (ERROR: 8180, SQLSTATE: 42000) (0x80040E14)
MCommand.h, xx, Invalid column name 'Column Name'. (ERROR: 207, SQLSTATE: 42S22) (0x89790002)
Solution
This error can be expected if there are changes in the external database, but these changes have not been included to the SELECT statements used in M-Files Admin tool.
The first thing to check is the SELECT statement under the object type:
- Open M-Files Admin tool and select the related Vault
- Select Metadata structure and Object types
- Select the object type and Connection to External Database tab
- Open the relevant connection and check that the SELECT statement uses correct columns
Also, remember to check the SELECT statements used in Advanced Vault Settings:
- Open M-Files Admin tool and select the related Vault
- Select Configurations and Advanced Vault Settings
Refresh Time filtering:
- Expand the Connections to External database and Object Types
- Select the relevant Object type and Refresh Time filtering
- Check that the SELECT statement uses correct columns
Quick Refresh:
- Expand the Connections to External database and Quick refresh
- Select the relevant Object type
- Check that the SELECT statement uses correct columns
