PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: FW: Nsql problem
Date: Jul 17 2005 12:37PM

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:     'sybperl-l@peppler.org' 
>         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  -  mpeppler@peppler.org  -  http://www.peppler.org/
Sybase DBA/Developer
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html