# File lib/dbi/handles/statement.rb, line 207
207:         def fetch(&p)
208:             raise InterfaceError, "Statement was already closed!" if @handle.nil?
209: 
210:             if block_given? 
211:                 while (res = @handle.fetch) != nil
212:                     @row = @row.dup
213:                     @row.set_values(res)
214:                     yield @row
215:                 end
216:                 @handle.cancel
217:                 @fetchable = false
218:                 return nil
219:             else
220:                 res = @handle.fetch
221:                 if res.nil?
222:                     @handle.cancel
223:                     @fetchable = false
224:                 else
225:                     @row = @row.dup
226:                     @row.set_values(res)
227:                     res = @row
228:                 end
229:                 return res
230:             end
231:         end