[freetds] what's wrong with this freebcp statement?
blackwaterdev at gmail.com
Fri Mar 17 10:10:57 EST 2006
Thanks for all your info and patience with me. I compiled it into php and
wrote a little php script that works fine.
On 3/17/06, James K. Lowden <jklowden at freetds.org> wrote:
> blackwater dev wrote:
> > If I use bcp for everything else, is there another way via freetds to
> > somehow move the blob data from the sql server to a local MySQL db
> > without using bcp?
> > I just installed sqsh and am not trying to go through the docs on it but
> > it would be really nice just to be able to use freetds.
> I spent the evening looking at the code, and I'm sorry to say you may be
> SOL. sqsh *might* work, if it tackles the problem more intelligently.
> The problem is that freebcp treats all data alike: it allocates a buffer
> for the column, reads the data into the buffer, converts it if necessary,
> and writes it out. Even if nothing's converted (as in the case of IMAGE
> data), a copy is made to bring the data out of libtds's memory.
> The copying isn't technically necessary, but neither is it a problem (for
> normal-size data), and eliminating it would take quite a bit of work.
> If sqsh doesn't work, the shortest route, for someone who knows how, would
> be to use Perl or adapt one of the db-lib unit tests:
> $ grep -l readtext src/dblib/unittests/*.c
> These programs use the readtext() function, which is what one needs (and
> what freebcp doesn't use) when reading blob data.
> That's the best we've got at this stage of the project, I'm afraid.
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
More information about the FreeTDS