Page 1 of 1

edit procedure or SQL's update?

Posted: 24.07.2007, 23:54
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?

Posted: 25.07.2007, 10:06
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.

Posted: 25.07.2007, 21:19
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?

Posted: 26.07.2007, 09:50
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.

Posted: 26.07.2007, 13:53
by trob
Thanks. So this is confirm me to use my own SQL-statements.