Hi all,
I want to extract and IMAGE BLOB from a Microsoft SQL 2000 server via a perl script on Solaris.

I have perl 5.6.1, freetds 0.61 and an early version of DBD::Sybase installed and I can run basic queries just fine.

I have used an explicit SET TEXTSIZE to avoid out-of-memory problems.

There is conflicting info in the DBD::Sybase vs freetds docs as to whether this is at all possible.

Right now, I get a segmentation fault in the following code:

my $sqlquery = "SELECT Date_, Graphic_Image from GRAPHIC_VIEW ..."; $dbHandle->{syb_binary_images} = 1; #return image as binary not hex my $sth = $dbHandle->prepare($sqlquery); $sth->{syb_no_bind_blob} = 1; $sth->execute; my $row; my $len; while(1){ # segementation fault in next statement $len = $sth->func(2,$imgchunk,2048,'ct_get_data'); last if $len != 2048; }

In reply to Retrieve MS SQL Image to per/UNIX by mcooperman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.