Received: from ns1.aktrad.ru (ns1.aktrad.ru [195.218.140.4]) by hub.org (8.9.3/8.9.3) with ESMTP id DAA51707 for ; Thu, 12 Aug 1999 03:02:15 -0400 (EDT) (envelope-from hook@aktrad.ru) Received: from sloth (sloth.aktrad.ru [195.218.140.13]) by ns1.aktrad.ru (8.8.8/8.8.7) with SMTP id LAA25577 for ; Thu, 12 Aug 1999 11:01:43 +0400 (MSD) (envelope-from hook@aktrad.ru) Message-ID: <02ae01bee490$81251ff0$0d8cdac3@aktrad.ru> From: "Gene Sokolov" To: Subject: ODBC (6.40.0006): SQL_TIME binary format (bug? feature?) Date: Thu, 12 Aug 1999 11:01:30 +0400 MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 I have a table (PGSQL 6.5.0): CREATE TABLE TimePeriods ( ID SERIAL PRIMARY KEY , MarketID INT NOT NULL REFERENCES Markets , WeekDay INT NOT NULL , /* 1-7, Sun-Mon */ TimeOpen TIME NOT NULL , TimeClose TIME NOT NULL ); I do (WinNT 4.0 sp 4, ODBC v. 6.40.0006) select * from timeperiods The TimeOpen and TimeClose are stored as 4 byte values in the database. But the ODBC driver returns them as 8 byte values in a completely unexpected format! The usual binary representation of an SQL_TIME is (high to low) 1 byte hours, 1 byte minutes, 1 byte seconds and the lowest byte 1/100s of a second. Here I get (low to high): int16 hours, int16 minutes, int16 seconds, and int16 0xCDCD. The result - 1/100s are lost and a lot of wasted network bandwidth. What is the point of formatting TIME like that? Why does it clip fractions of a second? Is it a bug or a feature? If it's a bug, how can I help fixing it? If it's a feature, why is it needed? Gene Sokolov.