Page 1 of 1

Editing Record from Query, updating entire table

Posted: 05.02.2009, 23:43
by rsickle
I'm converting a Delphi 2007 application from Advantage DB server over to Firebird and am having some problems. I am opening a query with a where clause and I am moving through each of the records and changing a text and blob field, but when I edit the fields, the change is effecting the entire table.

This is straight forward: a while loop not eof, set the query in edit mode, update the record, post then next. What the heck do I not have set correctly?

Posted: 06.02.2009, 06:39
by mdaems
Is a primary key available on the table and used in your query? Using the TZSQLMonitor you'll probably see the generated update statements do not have a (meaningful) where clause.

Useful information when this is not the case : create statement for the involved table, select statement for the query. If present : the statements in the UpdateSQL object.

Mark

Posted: 08.02.2009, 20:02
by rsickle
Thanks for the help. I added an AutoIncrement field to the table, included it in my query and that solved the problem.

Thanks,