| Deutsch English Français Italiano |
|
<vs69od$2sh2o$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Harald Oehlmann <wortkarg3@yahoo.com> Newsgroups: comp.lang.tcl Subject: Re: It's possible get sql error code using TDBC ? Date: Fri, 28 Mar 2025 14:55:25 +0100 Organization: A noiseless patient Spider Lines: 39 Message-ID: <vs69od$2sh2o$1@dont-email.me> References: <vs502b$1jv1q$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 28 Mar 2025 14:55:27 +0100 (CET) Injection-Info: dont-email.me; posting-host="52ab102e59ce480b30aa3e10d0b0f0e8"; logging-data="3032152"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+VYuaReBxepdqAPG5c1YAT" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:XQerT7Uwk8S0tJRfMtiLTRH2NPg= In-Reply-To: <vs502b$1jv1q$1@dont-email.me> Content-Language: en-GB Bytes: 2441 Am 28.03.2025 um 03:02 schrieb Luis Alejandro Muzzachiodi: > Hello, > > I am using the TDBC mysql driver. Maybe I'm not getting it but I can't > find how to retrieve the sql error message that a transaction returns. > That is, if I capture (for example, with catch) the error shows me all a > lot of data that, for practical purposes, it is too much information and > in English, of curse. Can the SQL code from the error be recovered?. In > this way, it could show a simpler message and in Spanish. > > Example: > > instead of show this ... > Cannot delete or update a parent row: a foreign key constraint fails > (`xxxx_DB01`.`xxx`, CONSTRAINT `RI_xxid` FOREIGN KEY (`xxid`) REFERENCES > `xx_xxx` (`xxid`) ON UPDATE CASCADE) > > because i received the error number 1451, i would show : > "No se puede borrar este blabla porque tiene bleble asociados" > > Thanks, > > Alejandro Alejandro, I have no answer, sorry. The funny thing is, that TDBC defines the error codes for all rivers, but only the ODBC driver follows it. But that is easy, as the TDBC error reporting is defined as to be the same for all platforms. At the end, I have a big driver-dependent if to catch some errors, I am intersted in (like "record exists" on insert). Sorry for the non-related noise. Consider to register a ticket in tdbc::mysql fossil. Massimo has eventually more insights... Harald