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: John_Erjavec at cargill dot com
Subject: RE: Prints for stored process not working in Perl5
Date: Aug 24 1999 3:53PM

     Not sure with DBlib, but with CTlib, the printed messages are sent to 
     the message handler with a $number of 0 and a $severity of 10.  The 
     default message handler discards anything with a severity <= 10, so 
     you need to install a new message handler.  Again, I don't know about 
     DBlib, but there is a file called 'ctutil.pl' that gets installed 
     with CTlib that prints 'print' messages to STDERR.  I'm planning on 
     modularizing this, since we like to see this information in our 
     scripts, and we don't necessarily want it to go to STDERR.  In most 
     cases we would want this logged with our logging modules.
     
     All of this is not DBlib, but they are similar enough that I thought 
     it might help you out.  Hope it does.
     
     -JEV
     -- 
     John Erjavec V
     Cargill, Inc.
     john_erjavec@cargill.com


______________________________ Reply Separator _________________________________
Subject: RE: Prints for stored process not working in Perl5
Author:  WechslerSM (WechslerSM@BERNSTEIN.COM) at mtka-unix-mime
Date:    8/24/99 10:09 AM


The output of print statements is normally sent to the message handler, not 
to dbresults.
     
--
Steve Wechsler/Senior DB Administrator/Sanford C. Bernstein & Co. 
WechslerSM@bernstein.com 
"Never underestimate the power of human stupidity" - Lazarus Long 
Support the Anti-SPAM amendment: http://www.cauce.org
     
     
> -----Original Message-----
> From: kvk@hmco.com [mailto:kvk@hmco.com] 
> Sent: Tuesday, August 24, 1999 9:10 AM
> To: SybPerl Discussion List
> Subject: Re: Prints for stored process not working in Perl5 
> 
> 
> 
> The ->sql method does a dbresults, dbnextrow loops,  Any and all 
> results sets are fetched.
> 
> 
> > You need to do the fetch in order to get them.  You have 
> only ran the query.
> > The results are in the result set (Buffer 2).  
> > 
> > Rgds
> > 
> > Venkat
> > 
> > I guess you can only get the content of the result sets 
> your procedure
> > returns, not the 'print'ed messages.
> > Probably you can use 'select' to get the messages in their 
> own result sets,
> > so, you have them coming out too, when you run your proc. 
> > 
> > -murali
> > 
> > 
> > > -----Original Message-----
> > > From:     kvk@hmco.com [SMTP:kvk@hmco.com] 
> > > Sent:     Monday, August 23, 1999 5:01 PM 
> > > To:       SybPerl Discussion List
> > > Subject:  Prints for stored procs not working in Perl5 
> > > 
> > > 
> > > I have always used prints in stored procs to get output.  
> I'm doing
> > > it now with Perl5 but the messages aren't coming out. 
> > > 
> > > Here's any example--
> > > 
> > > 
> > > ----------------------------------------------------------- 
> > >  create fooproc as print "This is a test"
> > > -------------------------------------------------- 
> > > #!/usr/local/bin/perl5
> > > use Sybase::DBlib;
> > > 
> > > $DB = Sybase::DBlib->dblogin('foouser', 'footest', 'CORPTSTW', 
> > > 'printproc');
> > > 
> > > $sql="exec fooproc";
> > > 
> > > $DB->sql($sql);
> > > 
> > > -------------------------------------------------- 
> > > 
> > > I get nothing on stdout when I run the program. 
> > > Any clue?
> > 
> > 
>