|
|
sybperl-l Archive
Up Prev Next
From: "Scott D Urban" <Scott_Urban at freddiemac dot com>
Subject: Re: datetime fields
Date: Oct 26 1998 5:28PM
Thanks for responding.
I had tried using UseDateTime, but isn't working. I must be doing
something wrong:
$self->{"Handle"} = Sybase::CTlib->ct_connect($ENV{"SybaseID"},
$ENV{"SybasePW"},
$ENV{"SybaseServer"});
$self->{"Handle"}->{ "UseDateTime" } = CS_TRUE;
Let me know if I'm doing something wrong.
Thanks again,
Scott
Michael Peppler on 10/26/98 11:16:45 AM
Please respond to SYBPERL-L@listproc.net
To: SybPerl Discussion List
cc: (bcc: Scott D Urban/ISS/HQ/FHLMC)
Subject: datetime fields
Scott D Urban writes:
> We use the datetime data type for our id fields (don't ask). I have just
> begun using the CTLib module and datetime fields in my result sets
(using
> ct_sql) seem to be getting truncated to the minute. Is there an
attribute
> I can set that will allow ct_sql to return the full field? I am new to
> perl, so an example of code would be appreciated.
This issue has just been discussed.
CTlib provides cs_dt_info() which will let you set a default date
conversion format. Unfortunately cs_dt_info() is buggy and does not
work in any version of sybperl that is offically out. I have a fixed
version here which I hope to release as 2.09_06 soon.
In the meantime, you can add a convert(varchar, datefield, 109) to get
the full date (with seconds and milliseconds).
Another alternative is to set UseDateTime to CS_TRUE, and retrieve the
dates in native datetime format.
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@mbay.net -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
|