Skip to Content.
Sympa Menu

freetds - [freetds] Bulkcopy in ct-lib

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: [freetds] Bulkcopy in ct-lib
  • Date: Wed, 4 Feb 2004 12:20:56 -0000

Hi,

This is primarily diected towards James, Freddy and any others interested in
ct-library.

I'm working on and off - mostly off at the moment :-( on the bulk library
parts of ct-lib

I'd been working on the premise, as agreed, that we would move common
functionality into libtds, and have the ct-library and dblibrary functions
call the common functions.

having started to cut the code, I'm beginning to doubt the wisdom of this,
for the following reasons.

Although on the surface there appears to be a good deal of congruence
between the two bcp API's - both have an "init" function, "bind" functions,
"get/send" functions and "batch/done" functions, there is actually quite a
lot of difference between the two.

The dblibrary functions are primarily aimed at "file-based" inputs/outputs.
The bcp_sendrow() function which allows data to be bcp-ed into the database
from bound program variables, is a bit like an afterthought - there's no
equivalent bcp_getrow() for example.
The ctlibrary functions are exclusively aimed at "program variable" inputs &
outputs. The bcp_sendrow() equivalent - blk_rowxfer() - is bi-directional.

This makes a lot of difference to the respective "bind" functions, and to
the "do it" functions which reference the bind information.
There's tons of code which would be specific only to dblib(), leaving only a
small subset of code you could regard as truly "common"

The ctlibrary bulk-library functions actually have much more in common with
the straight ct-library functions, so you have:

blk_alloc() -> ct_cmd_alloc()
blk_describe() -> ct_describe()
blk_bind() -> ct_bind()
blk_rowxfer() and blk_rowxfer_mult() -> ct_fetch() (for data retrieval)
blk_props() -> ct_con_props() / ct_cmd_props()

I'm beginning to think I might be better off building ctlibrary bulk-library
on it's own and sharing common code between it and ct-lib proper.

Looking further ahead, there appears to be a huge amount of commonality
between the bcp functions in dblibrary and those in odbc.
They look like they are identical!

Let me know your thoughts...


¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Bill Thompson
Securities Services Division
Merrill Lynch Europe

For very important information relating to this e-mail please click on this
link: http://www.ml.com/legal_info.htm







Archive powered by MHonArc 2.6.24.

Top of Page