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
|