Re: FW: Nsql problem
Michael Peppler <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.dbi.sybase |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 2005-07-15 at 16:17 -0400, Srinivasan, Ravikumar wrote: > > Sorry.. Here is the o/p > > $test.pl user password > This is sybperl, version 2.10 > > Sybase::DBlib version 1.46 11/06/98 > > Copyright (c) 1991-1998 Michael Peppler I suggest that you try a more recent version of sybperl and see if that fixes things. Michael > > $ > > Thank You. > Ravi > > ______________________________________________ > From: Srinivasan, Ravikumar > Sent: Friday, July 15, 2005 3:23 PM > To: '[email protected]' > Subject: Nsql problem > > I am having a problem. The call nsql does not call the call > back function. Am I doing something wrong here? > > (Code below). > > -Ravi > > #!/usr/local/bin/perl > use Sybase::Sybperl; > > dbmsghandle("Sybase::DBlib::nsql_message_handler"); > dberrhandle("Sybase::DBlib::nsql_error_handler"); > > $Sybase::DBlib::nsql_deadlock_retrycount=5; > $Sybase::DBlib::nsql_deadlock_retrysleep=100; > > $user=$ARGV[0]; > $password=$ARGV[1]; > > $dbh = Sybase::DBlib->dblogin($user, > $password,"TESTSERVER","TEST"); > > print "$Sybase::DBlib::Version"; > > > $callback=sub { > %r=@_; > print "$r{'name'}\n"; > return TRUE; > }; > > $dbh->sql("select name from sysobjects",$callback,TRUE); > #WORKS FINE. > > $dbh->nsql("select name from sysobjects","HASH",$callback); > #does not call call back > #####Code from example in document. > > sub parse_hash { > my %data = @_; > print "$data{'name'}\n"; > return TRUE; > > # Do something with %data > } > > > $dbh->nsql("select name from sysobjects","HASH", > \&parse_hash); #does not call the call back. > if ( $DB_ERROR ) { > # error handling code goes here, perhaps: > die "Unable to get stuff from really_huge_table: > $DB_ERROR\n"; > } > -- Michael Peppler - [email protected] - http://www.peppler.org/ Sybase DBA/Developer Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html