ruby-win32/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1-x86-mswin32/lib/sqlite3/statement.rb
# Binds value to the named (or positional) placeholder. If +param+ is a
# Fixnum, it is treated as an index for a positional placeholder.
# Otherwise it is used as the name of the placeholder to bind to.
#
# See also #bind_params.
Binds value to the named (or positional) placeholder. If +param+ is a
Fixnum, it is treated as an index for a positional placeholder.
Otherwise it is used as the name of the placeholder to bind to.


Binds value to the named ( or positional ) placeholder . If + param + is a Fixnum it is treated as an index for a positional placeholder . Otherwise it is used as the name of the placeholder to bind to .
def bind_param( param, value )
      must_be_open!
      reset! if active?
      if Fixnum === param
        case value
          when Bignum then
            @driver.bind_int64( @handle, param, value )
          when Integer then
            @driver.bind_int( @handle, param, value )
          when Numeric then
            @driver.bind_double( @handle, param, value.to_f )
          when Blob then
            @driver.bind_blob( @handle, param, value )
          when nil then
            @driver.bind_null( @handle, param )
          else
            @driver.bind_text( @handle, param, value )
        end
      else
        param = param.to_s
        param = ":#{param}" unless param[0] == ?:
        index = @driver.bind_parameter_index( @handle, param )
        raise Exception, "no such bind parameter '#{param}'" if index == 0
        bind_param index, value
      end
    end
def bind_param ( param , value ) must_be_open! reset! if active? if Fixnum === param case value when Bignum then @driver . bind_int64 ( @handle , param , value ) when Integer then @driver . bind_int ( @handle , param , value ) when Numeric then @driver . bind_double ( @handle , param , value . to_f ) when Blob then @driver . bind_blob ( @handle , param , value ) when nil then @driver . bind_null ( @handle , param ) else @driver . bind_text ( @handle , param , value ) end else param = param . to_s param = ":#{param}" unless param [ 0 ] == ?: index = @driver . bind_parameter_index ( @handle , param ) raise Exception , "no such bind parameter '#{param}'" if index == 0 bind_param index , value end end
Binds value to the named (or positional) placeholder.
Binds value to the named ( or positional ) placeholder .
param
value