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: "Manjeet Kalsi" <manjeet dot kalsi at prudential dot com>
Subject: Help pls.
Date: Oct 5 1999 1:08PM

Can someone tell what's wrong with the following script ...

$dbh->ct_execute("select name,si,tl,cr,cl,ds,dt,ro,do,su,an,ab,nf,ai,dn from
tempdb..dbo_tbl order by name");

while ($dbh->ct_results($restype) == CS_SUCCEED)
{
 # Skip non-fetchable results:
 next unless $dbh->ct_fetchable($restype);

 # Retrieve actual data rows:
 while (@DataRow = $dbh->ct_fetch)
 {
  $ColCtr = 0;

  foreach $Data (@DataRow)
  {
   if ($ColCtr == 0) { print "\nDATABASE: $Data\n"; }
   if (($ColCtr == 1) && ($Data == "Y")) { print "\tselect into/bulkcopy\n"; }
   if (($ColCtr == 2) && ($Data == "Y")) { print "\ttrunc log on chkpt\n"; }
   if (($ColCtr == 3) && ($Data == "Y")) { print "\tno chkpt on recovery\n"; }
   if (($ColCtr == 4) && ($Data == "Y")) { print "\tdatabase created for
load\n"; }
   if (($ColCtr == 5) && ($Data == "Y")) { print "\tdatabase suspect\n"; }
   if (($ColCtr == 6) && ($Data == "Y")) { print "\tddl in tran\n"; }
   if (($ColCtr == 7) && ($Data == "Y")) { print "\tread only\n"; }
   if (($ColCtr == 8) && ($Data == "Y")) { print "\tdbo use only\n"; }
   if (($ColCtr == 9) && ($Data == "Y")) { print "\tsingle user\n"; }
   if (($ColCtr == 10) && ($Data == "Y")) { print "\tallow nulls by default\n";
}
   if (($ColCtr == 11) && ($Data == "Y")) { print "\tabort tran on log full\n";
}
   if (($ColCtr == 12) && ($Data == "Y")) { print "\tno free space acctg\n"; }
   if (($ColCtr == 13) && ($Data == "Y")) { print "\tauto identity\n"; }
   if (($ColCtr++ == 14) && ($Data == "Y")) { print "\tidentity in nonunique
index\n"; }
  }
 }
}

The output should be:

Database: 
     print outputs depending on vale of ColCtr & Data values.

But instead I get everyhing printed even though the valeu of $Data is " ".

Thanks

Manjeet