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: YongHong dot Deng at bmo dot com
Subject: Suppress return code of SP
Date: Oct 8 1999 8:56PM

Hello,

I wrote a small program like the following:

#!/usr/local/bin/perl

use Sybase::CTlib;

$X=Sybase::CTlib->ct_connect("uid","pwd");
$X->ct_execute(@ARGV);

while (($rc=$X->ct_results($restype))==CS_SUCCEED)
{
  next unless $X->ct_fetchable($restype);
  if (@names=$X->ct_col_names()) {print "@names\n";}
  while (@data=$X->ct_fetch) {print "@data\n";}
}

When I execute a SELECT statement, it's ok, ONLY the retrieved data being displayed.
But when I execute a stored procedure, for example, sp_who, the following results are displayed:

spid status loginame hostname blk dbname cmd
1 running      sa                      0     master     SELECT
2 sleeping                 0     master     NETWORK HANDLER
3 sleeping                 0     master     DEADLOCK TUNE
4 sleeping                 0     master     MIRROR HANDLER
5 sleeping                 0     master     HOUSEKEEPER
6 sleeping                 0     master     CHECKPOINT SLEEP
COL(1)
0

I was wondering how to suppress the last 2 lines?

Thanks in advance!

Fred.