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: Francois Ochsenbein <francois at vizir dot u-strasbg dot fr>
Subject: Re: can't ct_get_data over 32768 bytes
Date: Jul 15 2000 7:17AM

For the DBlib, there is effectively a default limit of 32K
that has to be changed with the dbsetopt call to e.g.
$dbh->dbsetopt(DBTEXTSIZE, "1000000", 1000000)   for text/image up to 10^6 bytes

I'm not using CTlib, but I guess a similar call via $dbh->ct_options
with the CS_OPT_TEXTSIZE argument would solve the problem.

Good luck, Francois

>
>Hi guys,
>
>I stored gif images in the server using the ct_send_data.  Until now all
>I do is read.  I am extracting them to files.  However, my perl script
>cannot output anything bigger than 32768 bytes.  Here is my script:
>
>
>$dbh->ct_execute("select datalength(img_rest_1), img_rest_1 from
>rest_ima
>ge where id_rest = $rest_id");
>my $restype=0;
>while($dbh->ct_results($restype,0)==CS_SUCCEED){
>         next unless $dbh->ct_fetchable($restype);
>         print "datalength:  $dat[0]\n";
>my @row;
>         while (@row=$dbh->ct_fetch) {
>         ($ret, $d)=$dbh->ct_get_data(2);
>         }
>}
>
>  $gif_filename = $dest_dir . "/" . $rest_id . "-1.gif";
>  open(SOURCE, ">$gif_filename") or die "Couldn't open file
>$gif_filename for writing for writing $!\n";
>  print "\nwriting $gif_filename...\n";
>  print SOURCE $d;
>
>
>I don't know why that the the image is bigger than 32768, all I get is a
>file of 32768 bytes and it is corrupted, i.e., not properly closed.
>
>I don't know if $d can't more than 32768 bytes, as I am not aware of
>size limitation in perl variables.
>
>thanks,
>
>Patrick
>
================================================================================
Francois Ochsenbein       ------       Observatoire Astronomique de Strasbourg
   11, rue de l'Universite F-67000 STRASBOURG       Phone: +33-(0)3 88 150 755
Email: francois@simbad.u-strasbg.fr   (France)        Fax: +33-(0)3 88 150 740
================================================================================