FW: Nsql problem
"Srinivasan, Ravikumar" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.dbi.sybase |
|---|---|
| Message-ID | <B59251B85D7B9B43AB422EE320D4E3652D6230@gsnmp22es.firmwide.corp.gs.com> |
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 $ 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"; > }