From: Steve C. <ste...@sc...> - 2009-11-15 12:36:11
|
Hi People, I have a Firebird 2.1 database that works perfectly under Windows, but has been problematic under a migration to Kubuntu 9.10 with ODBC driver libOdbcFb.so. After initial problems installing and then using DBI:InterBase, I finally got ODBC working. But I have repeated problems with the date format (and quite possibly the integer format too). The database was created in a UK locale and Kubuntu is set to a UK locale. I have a row which I read once and I get 30/07/2009. I read it again later and get, say, 32231-08-2\x00. Sometimes the read works and sometimes not. Sometimes I get a valid date and sometimes I get a strange string, but always with the format nnnnn-nn-n\x00. If I use isql-fb, it works perfectly, but if I use just isql, it fails. So this leads me to believe it's an ODBC issue Here is an example, if I don't use any code but just use isql and I run the same query (select att_examination_dte from tbl_exam) three times, I get record 1 = 31893-11-15, twice and record 1 = 2009-07-24 (the correct value) the third time. There are 21 records in this table, here is the whole output (see below). What is causing this? I have tried uninstalling and reinstalling unixodbc, but it doesn't seem to make any difference. Regards Steve steve@steve-desktop:~$ isql end_db +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> select att_examination_dte from tbl_exam +----------------------------+ | ATT_EXAMINATION_DTE| +----------------------------+ | 31893-11-15 | | 31893-11-15 | | 31893-11-15 | | 31893-11-22 | | 31893-12-05 | | 31893-11-24 | | 31893-11-18 | | 31893-11-16 | | 31893-11-23 | | 31893-11-19 | | 31893-11-21 | | 31893-11-17 | | 31893-12-11 | | 31893-11-20 | | 31893-12-11 | | 31893-12-11 | | 31893-12-11 | | 31893-12-12 | | 31893-12-16 | | 31893-12-17 | | 31894-02-05 | +----------------------------+ SQLRowCount returns 21 21 rows fetched SQL> select att_examination_dte from tbl_exam +----------------------------+ | ATT_EXAMINATION_DTE| +----------------------------+ | 31893-11-15 | | 31893-11-15 | | 31893-11-15 | | 31893-11-22 | | 31893-12-05 | | 31893-11-24 | | 31893-11-18 | | 31893-11-16 | | 31893-11-23 | | 31893-11-19 | | 31893-11-21 | | 31893-11-17 | | 31893-12-11 | | 31893-11-20 | | 31893-12-11 | | 31893-12-11 | | 31893-12-11 | | 31893-12-12 | | 31893-12-16 | | 31893-12-17 | | 31894-02-05 | +----------------------------+ SQLRowCount returns 21 21 rows fetched SQL> select att_examination_dte from tbl_exam +----------------------------+ | ATT_EXAMINATION_DTE| +----------------------------+ | 2009-07-24 | | 2009-07-24 | | 2009-07-24 | | 2009-07-31 | | 2009-08-13 | | 2009-08-02 | | 2009-07-27 | | 2009-07-25 | | 2009-08-01 | | 2009-07-28 | | 2009-07-30 | | 2009-07-26 | | 2009-08-19 | | 2009-07-29 | | 2009-08-19 | | 2009-08-19 | | 2009-08-19 | | 2009-08-20 | | 2009-08-24 | | 2009-08-25 | | 2009-10-14 | +----------------------------+ SQLRowCount returns 21 21 rows fetched SQL> Regards Steve |