Skip to Content.
Sympa Menu

freetds - Re: return value from stored procedure

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Peppler <mpeppler AT peppler.org>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: return value from stored procedure
  • Date: Thu, 14 Jun 2001 07:35:30 -0700


Seo writes:
> Hi All,
> i have a problem get a return code from my stored procedure.
>
> This is my stored procedure with a 10001 return code.
> ---------------------------------------
> procedure foo
> as
> begin
> return 10001
> end
> ---------------------------------------
>
> So, How can i get it from Perl ?
> ---------------------------------------
> use DBI;
> my $dbh = DBI->connect("dbi:Sybase:server=server", 'usr', 'pwd',
> {PrintError => 0});
>
> $sth = $dbh->prepare("EXEC foo");

$sth->execute;
do {
while($data = $sth->fetch) {
if($sth->{syb_result_type} == CS_STATUS_RESULT) {
$status = $data->[0];
} else {
.... do something with other data returned from proc
}
}
} while($sth->{syb_more_results});

Michael
--
Michael Peppler - Data Migrations Inc. - mpeppler AT peppler.org
http://www.mbay.net/~mpeppler - mpeppler AT mbay.net
International Sybase User Group - http://www.isug.com
Sybase on Linux mailing list: ase-linux-list AT isug.com




Archive powered by MHonArc 2.6.24.

Top of Page