TEXT type problem with Sybperl (or CGI.pm?) 
Author Message
 TEXT type problem with Sybperl (or CGI.pm?)

Hello,

I've been coding a small database application to our Intranet. It uses
Sybase 10.0.2.7 and Sybperl 2.09. I use TEXT and IMAGE types to store
long ASCII and binary files. I have noticed a problem when retrieving
data from the database using dbreadtext. The data is received correctly,
only there are some additional rows printed out from the code when I
print the data to a dynamic HTML page. Does this have something to do
with the small number of bytes I read in at a time? What would be the
ideal amount to read in at a time, if there is any? Also, has anyone
else noticed this kind of behaviour?
The code follows....

(the dbh initializations have been executed succesfully)

    $dbh->dbcmd("select SOLUTION from FAQ_ITEM where FAQ_ID=$faq_id");
    $dbh->dbsqlexec; $dbh->dbresults;
    $dbh->dbreadtext($buf, 100);
    if ($buf eq "") {
        $solution = "";
    } else {
        $solution = $buf;
        while($bytes = $dbh->dbreadtext($buf, 100) != NO_MORE_ROWS) {
            if ($bytes == -1) {
                printError("Error retrieving the solution.", $query, 1);
            } elsif ($bytes == 0) {
                print "<P>";
            }
            else {
                $solution .= $buf;
            }
        } # End inner while loop
    }

After this $solution contains a the data from the database mixed with a
line from the code that was a few rows above that part. The same error
occurs when using the file upload functionality of netscape (when the
file is read in and displayed, there are parts of code from some
module...probably from CGI.pm or Sybperl...).
Is this a Sybperl problem or has it got something do to with CGI.pm?

Thanks...

--
Petteri Korkiakoski             www.evitech.fi/~jaripk


- The opinions are mine and not those of Ericsson Corporation



Mon, 18 Sep 2000 03:00:00 GMT
 TEXT type problem with Sybperl (or CGI.pm?)

Quote:

> Hello,

> I've been coding a small database application to our Intranet. It uses
> Sybase 10.0.2.7 and Sybperl 2.09. I use TEXT and IMAGE types to store
> long ASCII and binary files. I have noticed a problem when retrieving
> data from the database using dbreadtext.

There was a bug with dbreadtext() that was fixed in sybperl 2.09_01.
I would suggest that you get 2.09_04 (which is the latest release)
and try that.

If you still get the problem you should contact me directly.

Michael
--
Michael Peppler         -||-  Data Migrations Inc.

Int. Sybase User Group  -||-  http://www.isug.com



Mon, 18 Sep 2000 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. web.sql vs sybPerl/cgi vs ?

2. : cgi-sybperl-sybase question

3. Sybperl 1.011 and CGI

4. Delphi CGI Problem - CGI Program Only Runs When Delphi Also Runs

5. DBI.pm/oraperl.pm

6. error ORA-01855: AM/A.M. or PM/P.M. required

7. Data Transfer from Long data type to SQL Server Text data type column

8. Problem with Text Data Type

9. Problem with Text type on a MS SQL 7 Server

10. problem - column with data type text

11. VB5 and RDO Text data type problem

12. text and ntext data type problem


 
Powered by phpBB® Forum Software