Hi

Hi,
I have a Delphi app ( Delphi XE10 Tokyo) with SQL Server and TFDQuery with cachedupdates=true. When I Call a save function and use transaction and FDQquery1.Applyupdates , after commiting data , and user calls again the save function in the statement FDQquery1.Applyupdates I get the exception 'SQL_NODATA'.
I would be obliged if someone could give me a solution.

Thank you

Comments

  1. Hi Nick , its been some time with Delphi , but you may have to check a property on your TFDQuery or Dataset to see if there is "pending" modifications and then allow a call to "save".
    ( apology for my English , not my native language )

    Hope i helped.
    Sevastianos Vlachopoulos.

    ReplyDelete
  2. You can check for (ChangeCount > 0) before calling ApplyUpdates.

    ReplyDelete
  3. Σεβαστιανός Βλαχόπουλος

    I did not define Primry key for the SQL SERVER table and that caused the problem.

    Thank you very much for your help

    ReplyDelete
  4. Uwe Raabe

    I did not define Primry key for the SQL SERVER table and that caused the problem.

    Thank you very much for your help

    ReplyDelete
  5. You can always test if there are any pending updates calling method UpdatesPending. And also After calling applyupdates you must call commitupates. So this let know the query that there are no more pending updates. So if you call again Applyupdates you won't receive error.

    ReplyDelete

Post a Comment