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: "Srinivasan, Ravikumar" <ravikumar dot srinivasan at gs dot com>
Subject: FW: Nsql problem
Date: Jul 15 2005 8:17PM

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:	'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";
>     }