Getting last response messages and error codes from MySQL

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

Getting last response messages and error codes from MySQL

Post 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
Mohammed Parak
CAD RETAIL
Durban South Africa
http://www.cad.co.za
mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

Post by mparak »

Often use the functions
show errors;
show messages;
but was hoping for a more elegant solution.
Mohammed Parak
CAD RETAIL
Durban South Africa
http://www.cad.co.za
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

Getting last response messages and error codes from MySQL

Post 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
Mohammed Parak
CAD RETAIL
Durban South Africa
http://www.cad.co.za
Post Reply