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:
> 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 Peppler -||- Data Migrations Inc.
firstname.lastname@example.org -||- http://www.mbay.net/~mpeppler