Skip to Content.
Sympa Menu

freetds - Re: [freetds] Parameter Passing does work

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Parameter Passing does work
  • Date: Wed, 15 Jun 2005 20:49:32 -0400

Philip wrote:
> The explanations is unreal because Perl is working perfectly now in one
> of my machines.

Please indicate:

Server -- vendor, version, and service pack
TDS protocol version

Or kindly attach a TDSDUMP log of your test session.

I know what I'm talking about. I'd be interested to see what's different
about your setup.

--jkl

> What I did was to replicate the entire machine and use it for
> the next clients, because I could not find the reason. I hereby invite
> jkl to email me and I will invite him to log in via putty and using the
> Linux utility screen I can show how my "testsql.pl" script (below) works
> and retrieves all the parameter variables correctly. I can not explain
> why but it works.
> The proof of the pudding is eating it.
>
> #!/usr/bin/perl
>
> use strict;
> use DBI;
> my $server = "";
> my $db = "minixel";
> my $username = "sa";
> my $password = "";
>
> my $dbh = DBI->connect("dbi:Sybase:minixel:6976", $username ', $password
> ', {PrintError => 0});
> die "Unable for connect to server $DBI::errstr"
> unless $dbh;
> $dbh->do("use $db");
> my $query = "select host_name() declare \@minPriceBook varchar(100),
> \@maxPriceBook varchar(100)
> exec sp_GetBooksByPrice \@minPrice =2.00 , \@maxPrice = 20.00,
> \@lowestPricedBook = \@minPriceBook OUTPUT, \@highestPricedBook =
> \@maxPriceBook OUTPUT";
> my $sth = $dbh->prepare($query);
> $sth->execute();
>
> do {
> while(my $dat = $sth->fetch) {
> print "TYPE $sth->{syb_result_type}\n";
> print "Data @$dat[0] , @$dat[1] , @$dat[2] \n";
> if($sth->{syb_result_type} == 4042) { # it's a PARAM result
> print "Number: $dat->[0] \n";
> print "Varpar: $dat->[1] \n";
> }
> }
> } while($sth->{syb_more_results});
>
>
> $sth=undef;
> $dbh->disconnect;
>
>
>
> Philip
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page