Class: DBI::DatabaseHandle

Inherits:
Object show all
Defined in:
lib/libciel.rb

Instance Method Summary collapse

Instance Method Details

#execute_immediate(stmt, *bindvars, &block) ⇒ Object

execute-map,count-finish triplet. To use this method, you need to require dbi before requiring libciel.



125
126
127
128
129
130
131
132
133
134
# File 'lib/libciel.rb', line 125

def execute_immediate(stmt,*bindvars,&block)
	sth=execute(stmt,*bindvars)
	ret=0
	begin
		if block then ret=sth.map(&block).count end
	ensure
		sth.finish
	end
	ret
end