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 concerto dot com>
Subject: Re: Issues w/ error detection using DBI and multiple statements
Date: Apr 2 2002 5:56PM

That did it.  One bizare thing I noticed with this setup, I can now
just look at $rc (from $rc = $dbh->do('...sql...')) and get that it is
no undef, which wasn't working before.  Guess something to do w/ how
the eval works.  It works, so I won't question it too much.  Also not
sure why won't work with a prepare/exec, but again, it works this way,
so I won't ask questions...  :)

Thanks!

On Tue, Apr 02, 2002 at 08:25:11AM -0800, Michael Peppler wrote:
> Michael Burstin writes:
>  > On Tue, Apr 02, 2002 at 07:33:51AM -0800, Michael Peppler wrote:
>  > > Michael Burstin writes:
>  > >  > I am running into some issues with detecting errors when submitting
>  > >  > multiple SQL statements to the dataserver using DBI/DBD::Sybase.  Any
>  > >  > help that anyone can give me is greatly appreciated.  I am running
>  > >  > this under Solaris 8, Sybase 12.5, perl 5.005_03 (Sun compiled perl
>  > >  > which ships w/ Solaris 8), DBI 1.14 and DBD::Sybase .91.
> 
>  > >  > 		      ----------Begin----------
>  > >  > EXEC sp_configure 'identity burning set factor',  50
>  > >  > EXEC sp_configure 'number of devices',            100
>  > >  > EXEC sp_configure 'number of locks',              100000
>  > >  > EXEC sp_configure 'number of user connections',   1024
>  > >  > EXEC sp_configure 'number of remote connections', 100
>  > >  > EXEC sp_configure 'number of open objects',       10000
>  > >  > EXEC sp_configure 'number of open indexes',       10000
>  > >  > go
>  > >  > 		      -----------End-----------
> 
> OK - the following will correctly fail after the "number of user
> connections" call:
> 
> #!/usr/bin/perl -w
> 
> use strict;
> 
> use DBI;
> 
> my $dbh = DBI->connect('dbi:Sybase:troll', 'sa', '');
> $dbh->{RaiseError} = 1;
> #DBI->trace(3);
> 
> $dbh->{syb_do_proc_status} = 1;
> 
> $dbh->do("
> EXEC sp_configure 'identity burning set factor',  1
> EXEC sp_configure 'number of devices',            100
> EXEC sp_configure 'number of locks',              100000
> EXEC sp_configure 'number of user connections',   1024
> EXEC sp_configure 'number of remote connections', 100
> EXEC sp_configure 'number of open objects',       1000
> EXEC sp_configure 'number of open indexes',       10000
> ");
> 
> 
> If you want to catch the error you wrap the do() call in an eval {};
> block and check $@ for any errors.
> 
> Note that any successful sp_configure calls preceding the failure will
> remain at their new value.
> 
> Michael
> -- 
> Michael Peppler                              Data Migrations, Inc.
> mpeppler@peppler.org           *or*          mpeppler@mbay.net
> http://www.mbay.net/~mpeppler
> International Sybase User Group: http://www.isug.com
> 

-- 
Michael Burstin
NPI Engineer
Concerto Software *
978-952-0842
mikeb@concerto.com
*Davox & Cellit Corporations are now doing business as Concerto Software