I am programming in Delphi 6 (but I guess the situation is the same with Delphi 11.1 22 years later as well) and I am using the standard chain of components:
- TIBDataSet (from Delphi IBX - Interbase-Express) with custom (written by myself) Select/Resfresh/Modify/Insert-SQL code and SelectSQL/RefreshSQL code contains multiple tables joined together, but there is one base table whose some fields are updated in ModifySQL
- TDataSetProvider
- TClientDataSet
I am using connection to Firebird 3.0 server and generally everything works OK in other places. But I have one situation of posting updates where the error comes up:
Dynamic SQL Error
SQL error code = -206
Column unknown
REASON
At line 2, column 2
This is really strange - because my TIBDataSet has ModifySQL and it is perfectly correct. As I understand, then TIBDataSet tries to generate some UPDATE command automatically and it arrives at invalid command. My intention is to revoke the automatic generation of UPDATE and ask TIBDataSet to use ModifySQL. But what properties of those 3 components controls/determines that TIBDataSet should not try to generate SQL for update?
TDataSetProvider.ResolveToDataSet
is the right answer - it should be set True if one wish to use custom-written SQLs that are assigned toTIBDataSet
ModifySQL
andInsertSQL
. More documentation is available at:https://docwiki.embarcadero.com/Libraries/Sydney/en/Datasnap.Provider.TDataSetProvider.ResolveToDataSet
False
is the default value in which case the TClientDataSet/TDataSetProvider try to infere some automatically generated SQL and they can gravely fail.