Generated insert/updatesql includes calculated fields
Original Reporter info from Mantis: BigChimp
-
Reporter name: Reinier Olislagers
Original Reporter info from Mantis: BigChimp
- Reporter name: Reinier Olislagers
Description:
When your sqlquery's SQL is e.g. select * from employee for the sample Firebird database, you include a calculated field.
FPC will generate updatesql (and probably insertsql) where this calculated field is included which leads to an error, e.g. Firebird
DBConnection : PrepareStatement
attempted update of read-only column
Steps to reproduce:
Sample Lazarus application that demonstrates the problem
http://forum.lazarus.freepascal.org/index.php/topic,23196.msg138226.html#msg138226
Additional information:
Possible avenues for solution:
-
When generating insert/update statements, check for server calculated fields etc, when generating insert/updatesql, regardless of providerflags settings.
-
Perhaps more elegant solution would be to remove the providerflags for these fields (and set the read only flag).
Mantis conversion info:
- Mantis ID: 25513
- OS: Windows
- OS Build: Windows 7
- Build: 26417
- Platform: x64 (with x86 compiler)
- Version: 2.7.1
- Target version: 2.7.1