Michael Peppler wrote: >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. > Or try this:
qq[declare \@p int; \@p=exec spfoo \@p output; select \@p] > > > >>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 > >
smime.p7s
Description: S/MIME Cryptographic Signature