Jump to content
gkobler

TFDUpdateSQL Problem

Recommended Posts

I'm migration a project from FB4 to FB5, i use a TFDQuery and a TFDUpdateSQL component.
 
My project runs without any problems. I have updated the database from FB4 to FB5 now. Now i got a problem, when i update a Field in my table. The follow exception are rises
 
Im Projekt Project2.exe ist eine Exception der Klasse EFDDBEngineException mit der Meldung '[FireDAC][Phys][FB]-312. Genau update affected [0] Zeilen, [1] wurden angefordert' aufgetreten.
 
and
 
Im Projekt Project2.exe ist eine Exception der Klasse EFDException mit der Meldung '[FireDAC][DApt]-400. Update-Anweisung updated [0] anstelle von [1] Datensatz. Mögliche Ursachen: Aktualisierungstabelle hat keinen Primärschlüssel oder Zeilenbezeichner, Datensatz wurde von einem anderen Benutzer geändert/gelöscht' aufgetreten.
 
The data field are not updated. When i now set the property UpdateOptions.CountUpdateRecords to False, i just got the first exception and the fiel are updated to the table.
 
What can i do to avoid the exception? I think the problem should be in the TFDUpdateSQL Component, but something must be changed from FB4 to FB5?
 
Thanks for any hint
Gregor

Share this post


Link to post

May be this

 

Multi-row RETURNING behaviour

Client-side INSERT … SELECT, UPDATE, DELETE, MERGE and UPDATE OR INSERT queries containing the RETURNING clause may now return multiple records instead of raising error “multiple rows in singleton select” as it happened before.

These queries are now described as isc_info_sql_stmt_select during preparation, while in previous versions they were described as isc_info_sql_stmt_exec_procedure.

Singleton INSERT … VALUES statements, as well as positioned UPDATE and DELETE statements (i.e. the ones containing the WHERE CURRENT OF clause) preserve the existing behaviour, being described as isc_info_sql_stmt_exec_procedure. They also preserve the ability of being executed within a single protocol roundtrip to the server.

However, all these queries, if used in PSQL and the RETURNING clause is applied, are still treated as singleton.

 

 https://firebirdsql.org/file/documentation/release_notes/html/en/5_0/rlsnotes50.html#rnfb50-compat-returning

Share this post


Link to post

Thanks for clarifying and investigating. Attached my smal demo project. Just start it and try to change a value at any field. Immediately when you try to post this chages, the exception are raising.

 

Quality portal is still in read-only mode, so i can't report the bug.

FireDac Sample.7z

Share this post


Link to post

@VLDG, thanks ! Yes, this is the issue in FireDAC support for Firebird 5.

The issue is fixed, the changes will be included into Delphi 12 Update 1.

Edited by Dmitry Arefiev
  • Like 2

Share this post


Link to post

@Dmitry Arefiev should i go via the support to get a fix earlyer? Or could you post some infos here to fix it? Quality Portal is read only at the moment and it‘s not an option for that. 

Share this post


Link to post

it works for me. 🙂 Thanks a lot for your support!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×