Skip to Content.
Sympa Menu

freetds - Re: [freetds] RE: FreeTDS Digest, Vol 9, Issue 9

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Ole Hansen <oha AT city.dk>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] RE: FreeTDS Digest, Vol 9, Issue 9
  • Date: Thu, 09 Oct 2003 19:42:08 +0200

Hi,

I experience problems as well. The value returned before conversion is
two integers. The first integer holds number of days since 1900 (not
1970). The second integer holds number of milliseconds past midnight.
When I add 25567 days to the first integer I get a perfect match, ie. I
get the day I expect but when I translate the milliseconds into
hours/minutes/seconds - it's all wrong.

It seems like the milliseconds are right to some extend - at least the
error is constant but they are some 8-10 hours behind.

Ole







On Thu, 2003-10-09 at 12:47, David Nsengiyumva wrote:
> Hi there,
>
> Can anyone tell me how FreeTDS handles Date/Time and Currency values. I am
> running FreeTDS version 7.0 accessing MS SQL Sever and it works fine for
> anything else but Date/Time and currency values. Basically when I run a
> query that is supposed to return Date/Time values then the
>
> static int
> _ct_bind_data(CS_COMMAND * cmd) {
> ..............
> }
>
> in the ct-lib fails(returns CS_ROW_FAIL).
>
> The "srctype = curcol->column_type" has value 111(0x6F) and "desttype =
> _ct_get_server_type(curcol->column_bindtype)" has value 47(0x2F) and
> "srctype = _ct_get_client_type(curcol->column_type, curcol->column_size);"
> has value 6 (0x06)
>
> I have tried to step into the "cs_convert(CS_CONTEXT * ctx, CS_DATAFMT *
> srcfmt, CS_VOID * srcdata, CS_DATAFMT * destfmt, CS_VOID * destdata, CS_INT
> * resultlen)" function and get the following:
>
> src_type = 61(0x3D)
> src_len = 8
> desttype = 47(0x2F)
> destlen = 8
>
> The "TDS_INT tds_convert(TDSCONTEXT *tds_ctx, int srctype, const TDS_CHAR
> *src, TDS_UINT srclen, int desttype, CONV_RESULT *cr)" function in convert.c
> file, the switch case goes to SYBDATETIME and lenght get value 19 (0x13).
> and the log file report the following error:
>
> inside cs_convert() error_handler: Data-conversion resulted in overflow
>
> Thanx a lot for your help...This is kind of urgent so if you have a solution
> or a hint, please reply asap
>
> David Nsengiyumva
>
> Software Developer
> Tel: +27 21 464 7215
> Cel: +27 73 351 3975
> http://www.finsolutions.co.za
>
> CONFIDENTIALITY CAUTION
> This page and any accompanying documents contain privileged and confidential
> information for the specific individual to whom it is addressed, and are
> protected by law. If the reader is not the intended recipient, you are
> hereby notified that any review, dissemination, distribution or copying or
> the taking of any action based on the contents of this communication is
> strictly prohibited. If you have received this communication in error,
> please desist from reading the contents, notify us immediately and destroy
> the communication.
>
>
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>





Archive powered by MHonArc 2.6.24.

Top of Page