Page 1 of 1

Why use an Update Object?

Posted: 19.08.2011, 23:28
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

Posted: 22.08.2011, 07:30
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!