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: RE: return only a subset of a result
Date: May 22 1998 2:21PM

Phil Groce writes:
 > 
 > use Sybase::CTLib;
 > $dbh = new Sybase::CTLib 'user', 'pass', 'server';
 > $dbh->ct_sql('set rowcount 10');
 > $dbh->ct_execute('your query here');

You can also use ct_option() to set the rowcount (and other SET
options):

$dbh->ct_option(CS_SET, CS_ROW_COUNT, 10, CS_INT_TYPE);

 > What's really fun is playing with 'set showplan on' and other diagnostics.
 > Has anyone experimented with DBCC's thru Sybperl? (Not something I'd
 > personally try except on a test box, incidentally....)

The latest sybperl release (2.09_04) has a dbcc.pl script (in the eg/
directory) which runs checkdb, chackalloc and checkcatalog. It mails
any error messages back to the user, and stores the full log of the
session in a file. I've found that script to be quite usefull.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@datamig.com    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com