From: ChrisH Date: 2007-04-12T09:50:06+09:00 Subject: Re: Using dbi in a loop to execute a stored procedure... ...numberofcomps += 1 > end > > db.disconnect > puts "==== Company Creation Completed ====" > end > > Any advice or ideas would be greatly appreciated. that db.disconnect will be executed the first time through the while loop, move it to after the 'end' of the loop