Editing Record from Query, updating entire table

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
rsickle
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 05.02.2009, 23:26

Editing Record from Query, updating entire table

Post 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?
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
rsickle
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 05.02.2009, 23:26

Post 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,
Post Reply