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: "Bob Buehler" <bob dot buehler at cpa dot state dot tx dot us>
Subject: RE: HELP- SQL output not flowing through
Date: May 28 1999 5:40PM

Hi Noelle:

You need to chomp $login to remove the end of line character before issuing
your SQL query.
Hope this helps.

Bob Buehler
State of Texas
Comptroller of Public Accounts
(512)463-4361


> -----Original Message-----
> From: owner-SYBPERL-L@listproc.net
> [mailto:owner-SYBPERL-L@listproc.net]On Behalf Of Noelle Schreiber
> Sent: Thursday, May 27, 1999 1:40 PM
> To: SybPerl Discussion List
> Subject: HELP- SQL output not flowing through
>
>
>
>
> 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, "
>
> 	while ($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
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>