Skip to Content.
Sympa Menu

freetds - Re: [freetds] Sybase DATE and TIME data types

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: matthew.green AT datamartcomputing.com
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Sybase DATE and TIME data types
  • Date: Mon, 14 Sep 2015 08:19:39 +0000

I've found one file I modified which wasn't in my document... sorry about
that.

The change is to include/sybdb.h, around line 154:

enum
{
        SYBCHAR = 47,           /* 0x2F */
#define SYBCHAR SYBCHAR
        SYBVARCHAR = 39,        /* 0x27 */
#define SYBVARCHAR      SYBVARCHAR
        SYBINTN = 38,           /* 0x26 */
#define SYBINTN SYBINTN
        SYBINT1 = 48,           /* 0x30 */
#define SYBINT1 SYBINT1
        SYBINT2 = 52,           /* 0x34 */
#define SYBINT2 SYBINT2
        SYBINT4 = 56,           /* 0x38 */
#define SYBINT4 SYBINT4
        SYBINT8 = 127,          /* 0x7F */
#define SYBINT8 SYBINT8
        SYBFLT8 = 62,           /* 0x3E */
#define SYBFLT8 SYBFLT8
        SYBDATETIME = 61,       /* 0x3D */
#define SYBDATETIME     SYBDATETIME
        SYBDATE = 49,           /* 0x31 */
#define SYBDATE         SYBDATE
        SYBTIME = 51,           /* 0x33 */
#define SYBTIME         SYBTIME
        SYBBIT = 50,            /* 0x32 */
#define SYBBIT  SYBBIT
        SYBBITN = 104,          /* 0x68 */

I'll keep looking in case there's anything else.....

Cheers,

Matthew.
September 13 2015 12:19 PM, "Matthew" wrote:Thanks for the kind words. It
seems I must have missed something as
datacopy is working for me when copying DATE and TIME columns from ASE
15.7 to ASE 15.7.

A lot of what I did was trial and error and I tried to remember to leave
a comment so I could find what I'd changed in order to write it up at
the end.

Any idea which file I would have changed to get it working with dblib?
If not I'll untar the package somewhere else and run a find and diff to
see if I can spot it.

Cheers,

Matthew.

On 13/09/15 11:55, Frediano Ziglio wrote:
 2015-09-11 10:04 GMT+01:00 :Dear All,

I'm not really a C programmer (or C++ for that matter) but I wanted to be
able to use datacopy
tocopy tables with DATE and TIME data types. So, I decided to have a crack at
adding them to
FreeTDS.My testing has been successful, although I'm not sure the way I've
coded it is correct so any
help/fixes would be appreciated.

I've attached a rich text document with the details. The first part proposes
a quick and dirty
fix,while the second is my best guess at the "correct" way of doing things.

Bare in mind that this is currently only for Sybase to Sybase. I'm going to
look at doing this
forSQL Server too but that's a bit more complicated!

Cheers,

Matthew.

Patch and effort are really appreciated.
So appreciated that I already pushed some changes and is actually
testing deeply (but I don't think there will be any regression).

datacopy still does not work as SYBDATE/SYBTIME are not supported by
dblib (you added support for libTDS not upper libraries and datacopy
is based on dblib).

Currently converting from string will use datetime format in all
cases. ODBC has its standard so format strings are well defined for
it.

I added some improvements too based on previously patches on some other types.

Yes, adding a new type in FreeTDS is really a nightmare !!!

Frediano
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org (mailto:FreeTDS AT lists.ibiblio.org)
http://lists.ibiblio.org/mailman/listinfo/freetds
(http://lists.ibiblio.org/mailman/listinfo/freetds)




Archive powered by MHonArc 2.6.24.

Top of Page