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: "Avis, Ed" <avised at kbcfp dot com>
Subject: DBD::Sybase stored proc parameter binding doesn't work to bind just some parameters
Date: Jun 11 2004 12:44PM

I know that the bind parameter support for stored procedures in
DBD::Sybase is experimental but anyway I hope this bug report will be
useful.  Make a procedure:

    create procedure foo @a int, @b int as print "hello"
    grant execute on foo to whoever

Then try to run it using a statement handle with one bind parameter:

    use warnings;
    use strict;
    use DBI qw(SQL_INTEGER);
    use DBD::Sybase;
    my $dbh = DBI->connect(
      "dbi:Sybase:server=MY_SERVER;database=my_database",
      'whoever', 'password',
      { RaiseError => 1, AutoCommit => 0 }
    );

    my $sth = $dbh->prepare('exec foo @a = 1, @b = ?');
    $sth->bind_param(1, undef, SQL_INTEGER);
    $sth->execute(99);
    finish $sth;
    disconnect $dbh;

I expected foo to be called with parameters 1, 55.  But instead:

DBD::Sybase::st execute failed: Server message number=201 severity=16 state=2 line=0 server=TEST_LN procedure=foo text=Procedure foo expects parameter @a, which was not supplied.
DBD::Sybase::st execute failed: Server message number=201 severity=16 state=2 line=0 server=TEST_LN procedure=foo text=Procedure foo expects parameter @a, which was not supplied.
Issuing rollback() for database handle being DESTROY'd without explicit disconnect().

-- 
Ed Avis