Skip to Content.
Sympa Menu

freetds - [freetds] Status: bcp

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: TDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Status: bcp
  • Date: Thu, 18 Dec 2003 00:21:41 -0500

I haven't been able to bcp from host variables using current FreeTDS. In
comparing my home-grown application to freebcp, it became clear why
freebcp works and mine doesn't. Or, at least, it became clear how they're
different.

freebcp relies on bcp_exec(), which in turn is written directly to libtds.


My application uses bcp_bind() and bcp_sendrow(). Apparently,
bcp_sendrow() causes the "insert bulk" statement (or the row metadata; the
dump is at the office) to be sent. This is not what the server expects,
and the session is quickly terminated.

AIUI, bcp_sendrow() shouldn't have any effect on the packet. It only
means, OK, I'm done, that's it for this row. db-lib reads the bound host
variable buffers, constructs a row image, and feeds it to the regular
packetizer. As rows are fill the packets, they're sent (with the
more_date indicator). The only short packet would be at a bcp_batch()
boundary.

If I have any of that wrong, please stop me before I code again....

I'm writing a bcp unit test I'll use to debug the problem.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page