# File SQLRelay.rb, line 188 def bind_param(param, value, attribs) # in SQL Relay, bind variable names can be names or numbers and values # can be either strings, integers or floats. Floats come with precision # and scale as well. if value.kind_of? Float then # for float binds, check attribs for precision and scale if attribs precision = attribs['precision'].to_i scale = attribs['scale'].to_i end # if either of precision or scale is not passed in, extract them by # parsing the value around the decimal point or using defaults if precision.nil? or scale.nil? pr, sc = value.to_s.split(".") precision ||= pr.length || 8 scale ||= sc.length || 2 end @handle.inputBind(param.to_s, value.to_f, precision, scale) else @handle.inputBind(param.to_s, value) end end