我想在数组或散列中使用可变数量的值作为绑定变量,用于在 RhoMobile 的 RhoConnect 部分中使用 oci8 动态生成的 sql 更新字符串。不过不知道该怎么做:这是我的 irb 摆弄。
b(main):006:0> values = ['1','2']
b(main):007:0> @conn.exec( 'Select id, age, salary,name,company,gender from employee where id = :1 or id = :2', values ) do |row|
b(main):008:1* puts row[0]
b(main):009:1> end
ntimeError: unsupported datatype: 2
from C:/RhoStudiotest/ruby/lib/ruby/gems/1.8/gems/ruby-oci8-2.1.2-x86-mingw32/lib/oci8/oci8.rb:650:in `make_bind_object'
from C:/RhoStudiotest/ruby/lib/ruby/gems/1.8/gems/ruby-oci8-2.1.2-x86-mingw32/lib/oci8/oci8.rb:454:in `bind_param'
from C:/RhoStudiotest/ruby/lib/ruby/gems/1.8/gems/ruby-oci8-2.1.2-x86-mingw32/lib/oci8/oci8.rb:671:in `bind_params'
from (irb):9:in `each_with_index'
from C:/RhoStudiotest/ruby/lib/ruby/gems/1.8/gems/ruby-oci8-2.1.2-x86-mingw32/lib/oci8/oci8.rb:669:in `each'
from C:/RhoStudiotest/ruby/lib/ruby/gems/1.8/gems/ruby-oci8-2.1.2-x86-mingw32/lib/oci8/oci8.rb:669:in `each_with_index'
from C:/RhoStudiotest/ruby/lib/ruby/gems/1.8/gems/ruby-oci8-2.1.2-x86-mingw32/lib/oci8/oci8.rb:669:in `bind_params'
from C:/RhoStudiotest/ruby/lib/ruby/gems/1.8/gems/ruby-oci8-2.1.2-x86-mingw32/lib/oci8/oci8.rb:473:in `exec'
from C:/RhoStudiotest/ruby/lib/ruby/gems/1.8/gems/ruby-oci8-2.1.2-x86-mingw32/lib/oci8/oci8.rb:282:in `exec_internal'
from C:/RhoStudiotest/ruby/lib/ruby/gems/1.8/gems/ruby-oci8-2.1.2-x86-mingw32/lib/oci8/oci8.rb:275:in `exec'
from (irb):7
b(main):010:0>