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: Michael Peppler <mpeppler at MBAY dot NET>
Subject: problems with ct_execute
Date: Nov 3 1998 12:52AM

This is way late - but maybe you still have the problem....

Beth Breidenbach writes:
 > 
 > I'm unable to retrieve results from ct_executein my cgi, but _am_
 > able to successfully use ct_sql to get the same results.  Both
 > versions (ct_execute and ct_sql) work when called from the command
 > line.
 > 
 > The code is listed below.  We're using perl 5.004, Apache 1.3.?,
 > mod_perl 1.15, on Solaris 2.6, with Sybase 11.5.
 > 
 > Anyone have a suggestion as to what I'm missing???????

Are you using 'strict' with 'my' variables correctly?

I'm using code similar to yours and it works fine here...

Michael

 > 
 > ---------- code below  ---------------------------
 > 
 > use CGI::Switch;
 > use Sybase::CTlib;
 > ...print some html stuff....
 > $db=Sybase::CTlib->ct_connect('userid','passwd','server');
 > $db->ct_execute("select uid, name from sysuers");
 > while ( $db->ct_results($result) == CS_SUCCEED) {
 >     next unless $db->ct_fetchable($result);
 >     while ( ($uid, $name) = $db->ct_fetch ) {
 >         print "$uid - $name\n";
 >     }
 > }
 > ...print more html stuff...
 > 
 > If I substitute $db->ct_sql(select statement) for the ct_execute
 > statement and set @rows equal to the result, it works fine.  And,
 > the above works correctly if run command-line at the terminal.
 > 
 > Help?????????
 > 
 > Beth Breidenbach
 > 
 > 

-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@mbay.net       -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com