Skip to Content.
Sympa Menu

freetds - RE: [freetds] patch for new application program

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <bill_d_thompson AT ml.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] patch for new application program
  • Date: Tue, 16 Nov 2004 09:01:45 -0000

Freddy,

> I saw. I don't like dbtablecolinfo cause it's not a dblib function but
> an extension to ms and sybase libraries. Cannot this function be
> implemented using dbcolinfo?

Alas no. dbcolinfo calls dbcoltype() and dbvarylen(). Unfortunately the
data returned by these functions does not allow the caller to accurately
determine the column type in order to construct a "create table"
statement.
Specifically, using these functions you cannot distinguish between the
following column types:

CHAR(n) NULL

and

VARCHAR(n) [NOT] NULL

having run up against this issue, I tried to access the TDSCOLUMN
information directly from my (otherwise db-library) program. Doing this,
I hit the same sort of issues as another poster last week.
I came to the conclusion that the addition of a freetds-specific
dblibrary function was preferable to mixing dblibrary and tds-layer
structures in the program.

I don't see why creating extra db-library functions should be a bad
thing, if they fill functional deficiencies in the existing dblibrary
API, and do not compromise the behaviour of the existing functions.

Bill.


-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Frediano Ziglio
Sent: 15 November 2004 19:25
To: FreeTDS Development Group
Subject: Re: [freetds] patch for new application program


Il lun, 2004-11-15 alle 17:58, Thompson, Bill D (London) ha scritto:
> Hi All,
>
> I posted a patch to source forge last week.
>
> This patch includes a new application program - datacopy - which a
> couple of people have expressed an interest in recently.
> This program allows the user to move a table of data from one server
to
> another without the need for bcp-ing the data out and in.
> In so doing, it bypasses the need for intermediate data files, and is
> also faster, as it bypasses the need to convert data to and from
> character format.
>
> I have used the program extensively to migrate data from Sybase to SQL
> server, and vice versa, but it could have a variety of uses.
>
> I needed to make a few small changes to db-library to allow this
program
> to work.
> A couple were small and (probably undetected) bugs in existing
functions
> - dbcolinfo() primarily - but I also added a new dblibrary function -
> dbtablecolinfo() - to allow me to accurately describe a table without
> resorting to accessing TDS layer data.
>

I saw. I don't like dbtablecolinfo cause it's not a dblib function but
an extension to ms and sybase libraries. Cannot this function be
implemented using dbcolinfo?

freddy77


_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy, retain or
redistribute it. Click here for important additional terms relating to this
e-mail. http://www.ml.com/email_terms/
--------------------------------------------------------





Archive powered by MHonArc 2.6.24.

Top of Page