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 Burstin <mikeb at davox dot com>
Subject: capturing output from sp_configure
Date: Jun 9 2000 5:49PM

I am hoping that someone can help with a problem that I am having.  I
am trying to write a script which will issue some sp_configure
commands to the database (Sybase 11.9.2 under WinNT) using
DBI/DBD:Sybase.  What I am trying to do is to know whether the
database needs to be rebooted for the configuration to become active
(it is a part of a larger script which is adding devices, and needs to 
increase the 'number of devices' parameter. I have a script which
issues the command, and the config is committed to the database, but I 
need to capture the output (goes to STDOUT on the WinNT console) to
see whether I need to restart the server (or is there some other way
to determine).  I have taken a look at the DBD::Sybase (and
DBD:dbd-sybase) pages, and see some stuff that looks relevant, but I
can't seem ot put it all together correctly.

Here are the portions of the script that I am using (note some of the
commented out lines that I tried which don't work ($dbh is a valid
database handle, $parameter and $value are params passed to
sp_configure)): 

      my $sql = $dbh->prepare("sp_configure '$parameter', $value");
      #$sql->{syb_do_proc_status} = 1;
      $sql->execute();
      do {
	while (@results = $sql->fetchrow_array()) {
	  #print "begin: @results\n\n\n";
	}
	#@results = $sql->func('syb_output_params');
	#print "mikeb: |@results|\n";;
	#print "after\n\n";
      } while ($sql->{syb_more_results});


THis will get the results commited to the database, but I get the
following as output from the command line:

Configuration option changed. Since the option is static, Adaptive
Server must be rebooted in order for the change to take effect.

I either need to somehow capture this output or have some other way to 
know whether I need to restart the server.  

Any help is greatly appreciated.

-- 
Those who do not understand UNIX are  ++   Linux, The Ultimate
doomed to reinvent it, poorly.        ++  Windows Service Pack

Michael Burstin				mikeb@davox.com