On Thu, 2002-08-29 at 02:31, Michael Dalziel wrote: > > All, > > Having difficulty with an error message "no statement executing" against the > following > > my $dbh = DBI->connect($DATA_SOURCE,$USER,$PASSWORD,{AutoCommit => 0, > RaiseError => 0, PrintError => 0 }) or error("Can`t connect to db: > DBI::errstr", 1,2); > > # DBI->trace(2); > > > my $sth = $dbh->prepare(qq[declare \@p int exec spfoo \@p output]); > $sth->execute(); # Fails here
First of all you should print out any potential error messages, both for the prepare() and the execute() calls. Second, I believe that to get OUTPUT parameters this way you have to add a select @p after the exec. > Stored Proc is > > CREATE PROCEDURE foo > @p3 varchar(100) OUTPUT > as > > SET @p3 = 5 > GO I guess that's an MS-SQL extension - in Sybase I'd write select @p3 = 5 Michael -- Michael Peppler / [EMAIL PROTECTED] / http://www.mbay.net/~mpeppler [EMAIL PROTECTED] / ZetaTools, Inc / http://www.zetatools.com ZetaTools: Call perl functions as Sybase stored procedures!
signature.asc
Description: This is a digitally signed message part