SPUG:RE: Problems getting rows from sybase db

Brittingham, John john.brittingham at attws.com
Mon Apr 28 15:45:58 CDT 2003


	Oops I meant to type:  while(my @data = $dbh->dbnextrow(0)) 
	This should be: while(my @data = $dbh->dbnextrow)



>  -----Original Message-----
> From: 	Brittingham, John  
> Sent:	Monday, April 28, 2003 1:44 PM
> To:	spug-list at pm.org
> Subject:	Problems getting rows from sybase db
> 
> Having problem get dbnextrow to reurn the row, eventhough dbresults returns 1
> 
> #!/usr/local/bin/sybperl5 
> ##################################################
> # test_axys.pl                                 			  #
> # John Brittingham                           			  #
> #                                                			  #
> # Return: @data (regional and main db servers)   		  #
> #                                               			  #
> ##################################################
> require "axys_config.pl";
> require "pagelib.pl";
> if (!defined($NWRSDB_LIB))
>    { require "nwrsdb_lib.pl"; }
> if (!defined($NWRSCOMMON_LIB))
>    { require "nwrscommon_lib.pl"; }
> if (!defined($AXYSLIB))
>    { require "axys_lib.pl"; }
> 
> $dbh = Sybase::DBlib->dblogin($NavDBUsername, $NavDBPassword, $NavDBServer, $AppName);
> 	print("Data base Info ".$NavDBUsername." ".$NavDBPassword." ".$NavDBServer." ".$AppName."\n");
> $dbh->dbcmd("select NSS.name, NPDB.name from PFWUtil..NavAreaPhysicalDbSqlServer NAPDBSS, ". 
> 	"PFWUtil..NavAreaLogicalDb NALDB, PFWUtil..NavLogicalDb NLDB, PFWUtil..NavPhysicalDb NPDB, ".  
> 	"PFWUtil..NavSqlServer NSS, PFWUtil..NavArea NA where  NPDB.oid = NAPDBSS.oidPhysicalDb ".  
> 	"and  NSS.oid = NAPDBSS.oidSqlServer  and  NLDB.oid = NALDB.oidLogicalDb ".  
> 	"and  NALDB.oidAreaPhysicalDbSqlServer = NAPDBSS.oid and  NALDB.oidArea = NA.oid ".  
> 	"and  NLDB.name = 'AXYSDB' and lower(NA.name) like lower('Western%')\n");
>     $dbh->dbsqlexec;
>     while ($results = $dbh->dbresults != 2)
> 	{
> 	print("results=".$results."\n");
> 
>     	while(my @data = $dbh->dbnextrow(0))
>    	 {
>     		print(@data."\n");
>    	 }
> 
> 	}
> 
> 
> 
> John Brittingham
> Developer 1
> AT&T Wireless Services
> Bothell 7
> Cell: 206-484-2042
> ---------------------------------------------------------------
> "Non est mea culpa!!!!"
>  << OLE Object: Picture (Metafile) >> 
> 



More information about the spug-list mailing list