|
|
sybperl-l Archive
Up Prev Next
From: "Rob Verschoor" <rob at sypron dot nl>
Subject: I must be doing something wrong... (reading image data with DBD::Sybase)
Date: Jun 1 2007 8:41AM
Folks, I've looked everywhere but I cannot find the error I'm no doubt
making.
In short, I'm unable to read more than 32768 bytes from an image column,
although I've followed -afaik- all the required steps.
I've verified that the image stored in the image column is indeed bigger
than 32Kb (with datalength()). However, I'm getting only the first 32KB
returned.
My code:
$dbh->{LongReadLen} = 10000000;
$sth = $dbh->prepare("select img_col from my_table where id = 12345 ");
$sth->{syb_no_bind_blob} = 1;
$sth->execute;
while(my $d = $sth->fetch) {
$size = $sth->syb_ct_get_data(1, \$my_img, 0);
}
...which returns only 32KB.
However, when I select @@textsize prior to the prepare(), this returns
32768. In fact, I replaced setting LongReadLen with 'set textsize
10000000', and this does not change things: select @@textsize then still
returns only the first 32KB. I've verified through the MDA table
monSysSQLText that 'set textsize 10000000' is actually executed, so it
beats why @@textsize is still set to 32768.
Any hints appreciated!
Thanks,
Rob V.
rob@sypron.nl
|