|
|
sybperl-l Archive
Up Prev Next
From: "Shaw, James" <James dot Shaw at ubsw dot com>
Subject: (no subject)
Date: Jan 23 2002 6:11PM
In reference to http://taku.cren.net:8080/reguser/archives/SYBPERL-L/log0110/msg00024.html (sorry, I just subscribed)
for the extraction of IMAGE fields more than 32768, I am also having the same problem, even after setting TEXTSIZE.
$dbh = new Sybase::CTlib 'user', 'pass', 'server'
$sql = <ct_options(CS_SET, CS_OPT_TEXTSIZE, 2000000, CS_INT_TYPE);
$dbh->ct_execute($sql);
$textBind = 0; # If false, doesn't bind TEXT/IMAGE columns.
$text = "";
while(($rc = $dbh->ct_results($restype, $textBind)) == CS_SUCCEED) {
next unless $dbh->ct_fetchable($restype);
while(@row = $dbh->ct_fetch) {
foreach $col (@row) {
print "Col (length) = " . length($col) . "\n";
}
if (!($textBind)) {
do {
($ret, $data) = $dbh->ct_get_data(2);
print "Data (length) = " . length($data) . "\n";
$text .= $data;
} until ($ret == CS_END_DATA);
print "Total (length) = " . length($text) . "\n";
}
}
}
Results are ->
Data (length) = 32768
Total (length) = 32768
Have also tried setting textsize in the sql (set textsize 2000000) - but that makes no difference.
If I set $textBind to 1, I can extract 65536 characters but no more.
Any help or directions greatly appreciated.
Regards
James
Visit our website at http://www.ubswarburg.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.
|