Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
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 3:58PM

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.
>  > 
>  > I am attempting to write a perl script which will parse out a SQL text
>  > file, which, for historical reasons, used to be fed into the database
>  > directly through isql.  I can't modify the file format, so need to
>  > write a parser.  Here is a sample file:
>  > 
>  > 		      ----------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-----------
>  > 
>  > The problem that I am running into is that if one of the statements in
>  > the middle fails (in my case, the 'number of user connections'), I am
>  > not getting back a bad status.  
> What is the actual error string/number/severity that you get?

In this case, I am getting mutltiple entries into my error handler.
First is:

err: 5893, Sev: 16, message: 

The sum, (number of user connections) + (number of devices * max
online engines * 2) + (number of remote sites) + (max number network
listeners) + (max cis remote connections) + (number of java sockets),
must be no greater than '1014'

Followed by a 2nd entry into the error handler:

err: 5849, Sev: 16, message:
Verification failed for parameter 'number of user connections'.

If I set $dbh->{syb_do_proc_status} = 1, I come into the error handler
a 3rd time, this time,

err: 159, sev 1, message:
ct_cmd_drop(): user api layer: external error: This routine can be
called only if the command structure is idle. 

However, this time, it does not continue on processing the rest of the
batch that comes after the failed sp_configure.  Is there maybe a way
that I can just look at some attribute here?  Maybe I'm missing
something in the docs on how syb_do_proc_status works, and how to
handle its results.  Should I maybe just be doing a $dbh->do, rather
than a $dbh->prepare, $sth->execute?  

> Also, have you tried upgrading to DBD::Sybase 0.94? 
> The issue seems familiar, but I don't remember if it was something
> that got fixed in a "recent" version...

I just tried this on a differnt box (my dev box running Sol 8, perl
5.6, rather than my test box running as described above) and I get the
exact same results.

Michael Burstin
NPI Engineer
Concerto Software *
*Davox & Cellit Corporations are now doing business as Concerto Software