Page 1 of 1

Getting last response messages and error codes from MySQL

Posted: 12.03.2010, 08:09
by mparak
Dear Friends.

I often send a series of queries, and one often depends on another.
While I am able to get the rows updated, I often need to know more about the success or failure of the last query, and would love to know how.
What I need to know is:.

1. Was the last query successful?. If not what was the error.

Any contributions to this would be greatly appreciated.

Regards
M

Posted: 12.03.2010, 21:08
by mparak
Often use the functions
show errors;
show messages;
but was hoping for a more elegant solution.

Posted: 18.03.2010, 22:56
by mdaems
Hi,

As far as I know no mechanisms are build into zeoslib to get the exact error messages from the server.
Only thing I think of is the TZQuery.RowsAffected function which tells more about the result of DML queries.

Mark

Getting last response messages and error codes from MySQL

Posted: 19.03.2010, 10:56
by mparak
Dear Mdeams,

I have used the RowsAffected and "show errors" for a while now and while one gives me the number of insertions/edits/deletions , the other gives me the last error.
Between the two of them I am able to get most of my work done.
There are instances where I create multi-line sql commands that I execute as a script, and while this proves to be far more efficient it gives me very little back in the way of feedback. I was in an ideal world hoping for more meaningful interaction with the script that I initiated.
Looks like I am back to the drawing board, and maybe the answer lies more in the realm of MySQL than Zeos. In any case watch this space. I will post any new developments as soon as they hit me.

Regards
M