IBM_DB select multiple rows

I need to be able to select multiple rows in ruby.

I currently have the following code:
dbh = IBM_DB::connect(databaseName, “”, “”)
sql1 = “Select * from usernames”
sth = IBM_DB::exec(@dbh, sql1)
row1 = IBM_DB::fetch_array(sth)
puts row1

but this only returns the info for the top row returned. any and all
help is welcomed.

On Fri, Feb 22, 2013 at 1:26 PM, Bob S. [email protected] wrote:

help is welcomed.


Posted via http://www.ruby-forum.com/.

Not at all familiar with the IBM_DB module, but it looks so PHP-ish,
I’ll give it a go.

This looks like it retrieves one row from the selection:

row1 = IBM_DB::fetch_array(sth)
Therefore, my guess is you have to put that in a loop until no more
rows are returned.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs