Error Handling question

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

Error Handling question

Post by snorkel » Sun 13 Aug 2006 03:32

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

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 14 Aug 2006 10:05

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.

Guest

Post by Guest » Mon 14 Aug 2006 15:55

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

Guest

Post by Guest » Mon 14 Aug 2006 20:34

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

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 16 Aug 2006 10:52

You should use EMyError class to catch such errors. EMyError class provides only information about error code and error message retrieved from MySQL Server.

Post Reply