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: capturing print statements from a stored procs
Date: Oct 7 1997 9:04PM

Raja Sambamurty wrote:
> 
> Hi,
> 
> I am trying to convert a shell script to sybperl. What this script does
> is to call a bunch of SP's (a slight simplification) and redirect the
> output from the SP to a file. Everything works fine, except when
> there is a print in the SP. All the output from the select statements
> are returned via the dbnextrow but not the print statement(s). Any help
> would be appreciated.

PRINT statements are sent to the message handler, and are not returned
as 'normal' results.

To redirect the T-SQL PRINT statements to the same file you
need to define a new message handler that would output messages
with message number == 0 to the file instead of STDERR.

There are sample message handlers in sybutil.pl, which is in the lib
directory of the sybperl distribution.

Michael
--
Michael Peppler       -||-  Data Migrations Inc.
mpeppler@datamig.com  -||-  http://www.mbay.net/~mpeppler