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: Noelle Schreiber <noelle dot schreiber at central dot sun dot com>
Subject: HELP- SQL output not flowing through
Date: May 27 1999 6:40PM


Greetings.  

I am trying to get the output of the SQL statement in the following script to 
print to the screen.  However, when i run the script it simply gives me a value 
of 0 for each login entry I have in my 'logins.text' file. (I've double checked 
the SQL statment to know it works).

I am pretty new to PERL and to sybperl and would appreciate any input.  I have 
included the script below and it's output.


SCRIPT
--------


	use Sybase::DBlib;
	
	$srvdsk_db = Sybase::DBlib->dblogin('LOG IN HERE', 'PASSWD HERE', 'DB 		
	HERE', 'snapshot_app');
		
	open(LOGIN, ") {
	
	        $query = "select count(request_id) from Request where 			
				Request.login = \"$login\"";
	        $srvdsk_db->dbcmd($query);
	        $srvdsk_db->dbsqlexec;
	        while ($srvdsk_db->dbresults() !=NO_MORE_RESULTS) {
	                while(@data = $srvdsk_db->dbnextrow) {
	                        foreach $arg (@data) {
	                                print "Name:  $login\n";
	                                print "Number :  $arg  \n";
	                        }
	        }
	                }
	}
	close(LOGIN);
	



OUTPUT
----------

	[353] noelles@rc127: /share/rc/exe/perl snapshotv3.pl
	Name:  noelles
	
	Number :  0  
	Name:  csarros
	
	Number :  0  
	Name:  beckyr
	
	Number :  0  
	

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Noelle Schreiber
SUN
Email:		noelle.schreiber@central.sun.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~