timestamp as varchar(23)

timestamp as varchar(23)

am 12.02.2008 13:32:36 von Sergey.Zubkovsky

This is a multi-part message in MIME format.

------_=_NextPart_001_01C86D73.597B1960
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,

=20

I'm trying to get some "timestamp without time zone" column's value as a
varchar(23) value.

The SQLBindCol() function is used for this purpose in my C++ app.

However the result string doesn't contain milliseconds part at all while
the real column's value contains it ('2007-12-23 10:00:01.123' for
example).=20

After SQLFetch() the result's buffer contains '2007-12-23 10:00:01'
only.

The same program works fine with a MSSQLServer database so I cannot
suppose that there is something wrong in my app.

=20

OS: WinXP SP2

"PostgreSQL 8.3.0, compiled by Visual C++ build 1400"

ODBC Driver: PostgreSQL Unicode 08.03.01.00

Additional connection string settings:

ByteaAsLongVarbinary=3D1; TextAsLongVarchar=3D1; =
MaxVarcharSize=3D8000;
BoolsAsChar=3D0; BI=3D-5; LFConversion=3D0; LowerCaseIdentifier=3D0;

=20

How can I get "milliseconds part" in this case?

=20

Thank you.


------_=_NextPart_001_01C86D73.597B1960
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">


charset=3Dus-ascii">









style=3D'font-size:
10.0pt;font-family:Verdana'>Hi,



style=3D'font-size:
10.0pt;font-family:Verdana'> 



style=3D'font-size:
10.0pt;font-family:Verdana'>I’m trying to get some =
“timestamp without
time zone” column’s value as a varchar(23) =
value.



style=3D'font-size:
10.0pt;font-family:Verdana'>The SQLBindCol() function is used for this =
purpose
in my C++ app.



style=3D'font-size:
10.0pt;font-family:Verdana'>However the result string doesn’t =
contain
milliseconds part at all while the real column’s value contains it
('2007-12-23 10:00:01.123' for example).



style=3D'font-size:
10.0pt;font-family:Verdana'>After SQLFetch() the result’s buffer =
contains
'2007-12-23 10:00:01’ only.



style=3D'font-size:
10.0pt;font-family:Verdana'>The same program works fine with a =
MSSQLServer
database so I cannot suppose that there is something wrong in my =
app.



style=3D'font-size:
10.0pt;font-family:Verdana'> 



style=3D'font-size:
10.0pt;font-family:Verdana'>OS: WinXP SP2



style=3D'font-size:
10.0pt;font-family:Verdana'>"PostgreSQL 8.3.0, compiled by Visual =
C++
build 1400"



style=3D'font-size:
10.0pt;font-family:Verdana'>ODBC Driver: PostgreSQL Unicode =
08.03.01.00



style=3D'font-size:
10.0pt;font-family:Verdana'>Additional connection string =
settings:



lang=3DEN-US
style=3D'font-size:10.0pt;font-family:"Courier New"'>   
ByteaAsLongVarbinary=3D1; TextAsLongVarchar=3D1; MaxVarcharSize=3D8000;
BoolsAsChar=3D0; BI=3D-5; LFConversion=3D0; =
LowerCaseIdentifier=3D0;
size=3D2 face=3DVerdana> style=3D'font-size:10.0pt;font-family:Verdana'><=
/p>

style=3D'font-size:
10.0pt;font-family:Verdana'> 



style=3D'font-size:
10.0pt;font-family:Verdana'>How can I get “milliseconds =
part” in
this case?



style=3D'font-size:
10.0pt;font-family:Verdana'> 



style=3D'font-size:
10.0pt;font-family:Verdana'>Thank you.









------_=_NextPart_001_01C86D73.597B1960--

Re: timestamp as varchar(23)

am 14.02.2008 01:18:29 von Hiroshi Inoue

Zubkovsky, Sergey wrote:
> Hi,
>=20
> I=92m trying to get some =93timestamp without time zone=94 column=92s v=
alue as a=20
> varchar(23) value.
>=20
> The SQLBindCol() function is used for this purpose in my C++ app.
>=20
> However the result string doesn=92t contain milliseconds part at all wh=
ile=20
> the real column=92s value contains it ('2007-12-23 10:00:01.123' for=20
> example).
>=20
> After SQLFetch() the result=92s buffer contains '2007-12-23 10:00:01=92=
only.

could you try the driver on testing for 8.030101 at
http://www.geocities.jp/inocchichichi/psqlodbc/index.html
?

regards,
Hiroshi Inoue


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Re: timestamp as varchar(23)

am 14.02.2008 13:58:48 von Sergey.Zubkovsky

Yes, it works now!
I hope that the fixed driver will be released ASAP.
Thank you.

-----Original Message-----
From: Hiroshi Inoue [mailto:inoue@tpf.co.jp]=20
Sent: Thursday, February 14, 2008 3:18 AM
To: Zubkovsky, Sergey
Cc: pgsql-odbc@postgresql.org
Subject: Re: [ODBC] timestamp as varchar(23)

Zubkovsky, Sergey wrote:
> Hi,
>=20
> I'm trying to get some "timestamp without time zone" column's value as
a=20
> varchar(23) value.
>=20
> The SQLBindCol() function is used for this purpose in my C++ app.
>=20
> However the result string doesn't contain milliseconds part at all
while=20
> the real column's value contains it ('2007-12-23 10:00:01.123' for=20
> example).
>=20
> After SQLFetch() the result's buffer contains '2007-12-23 10:00:01'
only.

could you try the driver on testing for 8.030101 at
http://www.geocities.jp/inocchichichi/psqlodbc/index.html
?

regards,
Hiroshi Inoue


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend