[freetds] Problems with large image transfers.

Thompson, Bill D (London) bill_d_thompson at ml.com
Wed Sep 22 08:18:16 EDT 2004


Hi Dave,

freebcp is kind of my baby, so I'll also take a look at the issues.

There's a variety of issues with the program when it comes to BLOB data
- James has found some, and I can see several more.
However, I'll take these up with James et al on a separate thread. 
As he says, it may take a while to fix.

In the meantime though, let's try and overcome your immediate issue.
AIUI, You are starting off with a file that has your "image" data in it
- a binary file of some type.
You want to get this data into a table column of type IMAGE (column 5,
called snap_data from your format file).

Might I suggest that you take a look at one of our dblibrary test
programs.
These can be found in src/dblib/unittests . 
There are two programs here, called t0013.c and t0014.c , which do
precisely this.
These could be easily adapted into a program that would do what you
want.
They use standard dblibrary functions which may already be known to you.
If not, they are documented on both Sybase and MS (SQL server BOL).

If you don't feel happy about adapting these programs, I'll happily
knock something up for you...if you can wait a few days.

Good Luck,

Bill




-----Original Message-----
From: freetds-bounces at lists.ibiblio.org
[mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of David Lambert
Sent: 21 September 2004 21:34
To: FreeTDS Development Group
Subject: Re: [freetds] Problems with large image transfers.


Lowden, James K wrote:

>Oh, boy.  You found a doozie.  
>
>It's interesting that I assumed you meant bcp *in*.  I've uploaded
image
>data, but never downloaded it.  Neither, I bet, has anyone else,
because
>it looks to me like the code's broken.  
>
>  
>
Originally, I WAS trying to UPLOAD data, but never got it to work with 
freebcp. I eventually managed to get the data uploaded using a crude 
script with bsqldb, but then the data file was in '0xnnnn' nibbles which

meant > 100% overhead. Anyway, I then tried to used freebcp to DOWNLOAD 
the images, hoping that I could get some clue as how to UPLOAD images in

byte form. Then came the bug =-O . I am conversant with MySQL but very 
much a newbie to freeTDS/MSSQL/SYBASE, so please excuse the random 
thrashing of your code ;-)

>This will take some work, and it may be a few weeks before I can get to
>it, thanks to the phone company.  If you want to trace through more
>carefully, find out what dbconvert() is called with, returns, and what
>fwrite is being called with, I might be able to suggest a patch.  
>
>  
>
No hurry. Now that I know that the download is broken, it does not 
matter so much. I just need to figure out how to efficiently upload 
images. Could you point me to some documentation e.g. a HOWTO aimed at 
my level of (in)expertise?

Regards,

Dave.


_______________________________________________
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/ 
--------------------------------------------------------
 



More information about the FreeTDS mailing list