So I'm back to (trying to) migrate 100% to FireDAC and running into a seemingly stupid/noob/perplexing problem...

So I'm back to (trying to) migrate 100% to FireDAC and running into a seemingly stupid/noob/perplexing problem against an IBM iSeries. (Existing software uses variously BDE [yes, I know], DBX or ADO, all fine, but all legacy dependencies that I'd like to get away from.)

The basic problem is that basic dataset based update code simply does not work. That is, setting up a TFDConnection, TFDQuery and then attempting to update a table just simply does not work. The dataset is eiter read-only, or if I "force things" (for example by setting "UpdateNonBaseTables" or by unsetting "UpdateOptions.CheckReadOnly") then errors are generated.

Specifically, setting "UpdateNonBaseTables" to True allows the dataset to go into edit mode but then generates the following error:

EODBCNativeException with message '[FireDAC][Phys][ODBC][IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0104 - Token . was not valid. Valid tokens: , FROM INTO.'"

Using the FireDAC Monitor to trace the calls, I can see the origin of this error, the SQL generated is as follows:

>> TEST: TFDDAptTableAdapter($03776BF0).Lock: TFDPhysODBCCommand($036F86B0).Unprepare [Command="SELECT
FROM TESTWP.TEST A
WHERE A.ID = :OLD_ID AND A.SOMETEXT = :OLD_SOMETEXT
FOR UPDATE"]

As you can see no field list is being generated for reasons I don't understand.

If instead I clear UpdateOptions.CheckReadOnly, then the following error is generated instead:

[FireDAC][Phys]-329. Cannot generate update query. WHERE condition is empty.

Again, this seems to be somehow related to the fields being not considered for inclusion for updating/locating records for reasons unknown.

I've posted to Emba's forums (old: https://goo.gl/pBzSve, new: https://goo.gl/P9C9Km) with zero response so far.

Other salient details: Windows 10, Delphi 10 #Seattle, iSeries OS v6r1, iSeries ODBC driver v7r1.

What am I missing? Any suggestions/help would be highly appreciated!
https://goo.gl/pBzSve

Comments