Why use an Update Object?

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

Moderators: gto, EgonHugeist

Post Reply
IbeDBob
Junior Boarder
Junior Boarder
Posts: 47
Joined: 27.05.2010, 21:04

Why use an Update Object?

Post by IbeDBob »

Hi All,

SeaWolf helped me with some code for updating a Table but it is twice as much coding as a standard "Update" SQL script.

So why use an Update Object then?

Thanks

Bob
Thanks

Dyslexic Bob
Wild_Pointer
Expert Boarder
Expert Boarder
Posts: 164
Joined: 18.03.2008, 13:03
Contact:

Post by Wild_Pointer »

Hello, IbeDBob,

If you have a simple query like 'select id, name from person' in a tzquery then the component is capable of performing inserts, updates and deletes. The problem occurs then the query gets complex (using several tables). In that case you would not be able to use methods like Insert, Edit, Post, Delete. To enable you using these TDataSet methods the Update component is provided. Using it you can change the default insert/update/delete operations too (if you are using stored procedure for editing some table for example).
You can always use your own TZQuery object with you INSERT or UPDATE SQL for data manipulations, but that way you lose some of functionality of data aware components like TDBGrid.

Good luck!
Post Reply