Skip to Content.
Sympa Menu

freetds - Re: need some help with freebcp

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Wilson, John" <John.Wilson AT savvis.net>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: need some help with freebcp
  • Date: Wed, 23 Oct 2002 16:24:23 -0500


All:
I captured the daily build and then fetched the
patch below, found in bcp.c 1.29.

This patch fixed the problem when a row contained a
NULL field when trying to import (read in) into the DB.

This fixed freebcp to allow the orginal command to run.
I've run into another issue, where the code is getting
stuck in a loop and I'll submit that under another thread.

Thanks for the fix Bill!
jd

-----Original Message-----
From: Thompson, Bill D (London) [mailto:ThompBil AT exchange.uk.ml.com]
Sent: Wednesday, October 23, 2002 2:05 AM

OK,

I've found John's bcp problem.
This can be fixed by the addition of the following 2 lines of code in bcp.c
Could someone do that for me ? Ta.

function _bcp_read_hostfile():

if (hostcol->term_len > 0
{
bytes_read = _bcp_get_term_data(hostfile, hostcol, coldata);

if (bytes_read == -1)
return FAIL;

if (collen)
collen = (bytes_read < collen) ? bytes_read : collen;
else
collen = bytes_read;

+ if (collen == 0)
+ data_is_null = 1;

if (hostcol->tab_colnum)
{
....
Bill




Archive powered by MHonArc 2.6.24.

Top of Page