Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Re: Sybperl Datetime and Open Client Version
Date: Oct 19 1998 11:25PM

John A. Lewis wrote:
> I have quite a few Sybperl scripts that work with datetime columns.
> These scripts all break if I use any version of Open Client newer than
> 10.0.4 EBF 6847.  The reason is that the precision on the string version
> of the datetime has changed.  In the older versions of Open Client, I
> get values like 'Oct 19 1998  3:54:03:446PM', which I can then use in
> the where clause of a SQL statement and get an exact match since the
> milliseconds are included.  In the newer versions of Open Client, I only
> get 'Oct 19 1998  3:54PM', which no longer has enough precision for an
> exact match.  Anyone know why this is happening and how I can fix it?

One way is to include a full convert() call in the SQL, something like 
convert(varchar, date, 109) (not sure if 109 is the right format,

Another way is to set $dbh->{UseDateTime} on and retrieve the date in
native format - which will let you have the full precision.

A third possibility would be to play with the locale files, although I
tried this at all.