[Wtr-general] Data driven tests
Balakrishna
balakrishna.venkatappa at ionidea.com
Mon Jan 8 12:30:28 EST 2007
Hello Chris,
Thanks for the response. I will try this solution. If you have an example of
the same ,plz share it to me.
Any methods to find the size of array .
Also my question regarding the while loop does not execute the statements
until End is reached. How do I overcome this ?
Balu
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Chris McMahon
Sent: Monday, January 08, 2007 11:21 AM
To: wtr-general at rubyforge.org
Subject: Re: [Wtr-general] Data driven tests
sth = dbh.run("Select * from tbl_dl")
all_records = sth.fetch_all
all_records now contains an ArrayOfArrays, where each row is a record in the
outer array, and each value in each row is an element in the inner array.
Assume "tbl_dl" has records for NAME and ADDRESS. all_records now contains
[[NAME1,ADDRESS1],[NAME2,ADDRESS2],[NAME3,ADDRESS3]]
and that should get you where you need to go.
http://www.ch-werner.de/rubyodbc/odbc.html is a good resource.
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070108/60493683/attachment-0001.html
More information about the Wtr-general
mailing list