From: tamouse mailing lists Date: 2013-02-23T13:12:38+09:00 Subject: Re: IBM_DB select multiple rows On Fri, Feb 22, 2013 at 1:26 PM, Bob Smyph wrote: > 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. > > -- > 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.