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: Don Hosek <dhosek at webley dot com>
Subject: Re: retrieve a text field with CTlib
Date: Jun 3 1999 8:46PM

Sheree Hemphill wrote:
> Could anyone give me a short example of how to retrieve data where the
> column you want to retrieve is of datatype text?
 
> For example, if I use the following statement:
> @rows = $dbh->ct_sql("select textfield from...");
> How do I navigate through the textfield column that is returned?

@rows will be an array of arrays. You could do something along the lines
of 
for $i (0 .. $@rows) {
  print "$rows[$i][0]\n";
}

to print the values returned.

And of course because TMTOWTDI, you could use my preferred method:

for (@rows) {
  print "$$_[0]\n";
}

(which I normally use when @rows is an array of hashes).

-dh