edit procedure or SQL's update?

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
trob
Senior Boarder
Senior Boarder
Posts: 51
Joined: 20.03.2007, 02:24

edit procedure or SQL's update?

Post by trob »

Which is better? Which is faster? Why?

1.
Using the dataset's insert, edit , post and delete procedures
OR
setting directly the SQL property and then call execsql?

2.
Using master-detail arrangement
OR
refresing the dataset in the other table's afterscroll event?
pol
Senior Boarder
Senior Boarder
Posts: 91
Joined: 13.10.2005, 08:19

Post by pol »

Using the "automatic" features (using the dataset's procedures and the master-detail arrangement) is certainly easier - as long as it works, but it should work in most cases. Performance should be the same, as in any case it is just SQL. If you are not content with the performance of automatically generated statements, use the Monitor component and take a look at what is really going on.
trob
Senior Boarder
Senior Boarder
Posts: 51
Joined: 20.03.2007, 02:24

Post by trob »

Thank you.

If it is the same in fact, i remain at normal SQL statements, it think this is a littlebit easier.
But doesn't it produce more SQLs for all kind of sure things and checkings when it generate automaticly?

In which cases doesn't work the automatic generating?
pol
Senior Boarder
Senior Boarder
Posts: 91
Joined: 13.10.2005, 08:19

Post by pol »

When the query is too complex Zeos can not decide how to build e.g. the update statemant. In this case you have to use TZUpdateSQL and write your own udate, insert etc. code. Sometimes Zeos generates very complicated (WHERE ... AND ... AND ...) update statement. You can control that setting TZQuery's WhereMode property to wmWhereKeyOnly, if you have a primary key. Just an example.
trob
Senior Boarder
Senior Boarder
Posts: 51
Joined: 20.03.2007, 02:24

Post by trob »

Thanks. So this is confirm me to use my own SQL-statements.
Post Reply