Page 1 of 1

Error Handling question

Posted: Sun 13 Aug 2006 03:32
by snorkel
Hi,
I am fairly new to Mysql and the CoreLab vcl compoents.
My primary background is with Postgresql and after a query executed in PG the server would return a small record with the error info in it, i.e. line numbers character positions etc. This was handy because you didn't have to parse query line numbers/positions out of the error message itself.

Just wondering if Mysql has anything similar.

Thanks,

Snorkel

Posted: Mon 14 Aug 2006 10:05
by Antaeus
MySQL Server also returns some information that helps to localize error in the query. As a rule this information includes line number in the query and symbol near what the error appears.

Posted: Mon 14 Aug 2006 15:55
by Guest
Antaeus wrote:MySQL Server also returns some information that helps to localize error in the query. As a rule this information includes line number in the query and symbol near what the error appears.
Hi,
How do I access this error information? Do i have to use a specific exception type to get at it?

i.e
on e:mydacsqlexception do ???


Thanks,

Tony

Posted: Mon 14 Aug 2006 20:34
by Guest
Postgresql returns a error structure after the query runs that contains various error information already seperated out. i.e. error position, error message.
I can then grab that structure which fills property values in the special postgres exception handler. I don't have to parse the error message to get the line number etc.

I guess my question should have been, do I have to parse the error message myself to get line numbers etc?

Thanks,

Snorkel

Posted: Wed 16 Aug 2006 10:52
by Antaeus
You should use EMyError class to catch such errors. EMyError class provides only information about error code and error message retrieved from MySQL Server.