|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: @res?
Date: May 19 1999 5:22PM
Louis Proyect writes:
> I am using the new version of sql.pl which does not print the value of @res
> after &sql is called. However, if I print @res in sql.pl, it appears okay.
> What's the problem? (I haven't had the time to bone up on Perl 5, but I
> have a feeling that this has nothing to do with which version I am using.)
>
> ======================
> #!/usr/local/bin/perl
> use Sybase::DBlib;
> require "sql.pl";
> $dbh = Sybase::DBlib->dblogin("xxx", "yyyy", "zzz");
> &sql($dbh, 'sp_helpdb');
> print @res;
You're printing @res, but you never assign to it.
You probably want:
@res = &sql($dbh, 'sp_help');
print @res;
That said, you should probably use
$dbh->sql(...);
instead. The return value is a little different, but you should be
able to use it a lot better.
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@peppler.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
|