PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Rob Verschoor" <rob at sypron dot nl>
Subject: Re: I must be doing something wrong... (reading image data with DBD::Sybase)
Date: Jun 1 2007 12:56PM

Thanks, that tracing helped me identify (and fix) the problem.

However, I have a follow-up question. It appeared I hadn't properly closed 
a statement -- now when the 'set textsize' command was then executed, this 
was done in a different session according to this messages:

"syb_st_prepare() parent has active kids - opening new connection"

Question:
This is nasty -- if a command is suddenly executed in a different session, 
all bets are off. Is there a way to stop this and let the operation just 
fail?

Thanks,

Rob V.





----- Original Message ----- 
From: 
To: 
Sent: Friday, June 01, 2007 11:26
Subject: Re: I must be doing something wrong... (reading image data with 
DBD::Sybase)


> Weird.
>
> I just tried it here (using the test script t/xblob.t as a sample) with 
> no
> problems:
>
> $dbh->{LongReadLen} = 100000;
> $sth = $dbh->prepare("select id, data from blob_test");
> $sth->{syb_no_bind_blob} = 1;
> $sth->execute;
> while(my $d = $sth->fetch) {
>    my $data;
>    my $read = $sth->syb_ct_get_data(2, \$data, 0);
>    print "read = $read\n";
>
> }
>
>
> And I get:
>
> [pepm01a@gvas1tkc6001 DBD-Sybase-1.08]$ perl test/readimg.pl
> read = 96804
>
> Maybe a run with DBI->trace(5) could give us some more information...
>
> Michael
>
>
>
>
> Internet
> rob@sypron.nl@peppler.org - 01.06.2007 10:41
>
> Please respond to rob@sypron.nl
> Sent by:        owner-sybperl-l@peppler.org
> To:     sybperl-l
> cc:
> Subject:        I must be doing something wrong... (reading image data
> with DBD::Sybase)
>
> 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
>
>
>
> This message and any attachments (the "message") is
> intended solely for the addressees and is confidential.
> If you receive this message in error, please delete it and
> immediately notify the sender. Any use not in accord with
> its purpose, any dissemination or disclosure, either whole
> or partial, is prohibited except formal approval. The internet
> can not guarantee the integrity of this message.
> BNP PARIBAS (and its subsidiaries) shall (will) not
> therefore be liable for the message if modified.
>
>                ---------------------------------------------
>
> Ce message et toutes les pieces jointes (ci-apres le
> "message") sont etablis a l'intention exclusive de ses
> destinataires et sont confidentiels. Si vous recevez ce
> message par erreur, merci de le detruire et d'en avertir
> immediatement l'expediteur. Toute utilisation de ce
> message non conforme a sa destination, toute diffusion
> ou toute publication, totale ou partielle, est interdite, sauf
> autorisation expresse. L'internet ne permettant pas
> d'assurer l'integrite de ce message, BNP PARIBAS (et ses
> filiales) decline(nt) toute responsabilite au titre de ce
> message, dans l'hypothese ou il aurait ete modifie.
>
>