class DuckDB::PreparedStatement
def bind_decimal(index, value)
stmt = PreparedStatement.new(con, sql)
sql ='SELECT value FROM decimals WHERE decimal = ?'
con = db.connect
db = DuckDB::Database.open('duckdb_database')
require 'duckdb'
that can be parsed into a BigDecimal.
The second argument value is to expected BigDecimal value or any value
The index of first parameter is 1 not 0.
The first argument is index of parameter.
binds i-th parameter with SQL prepared statement.
def bind_decimal(index, value) decimal = _parse_deciaml(value) lower, upper = decimal_to_hugeint(decimal) width = decimal.to_s('F').gsub(/[^0-9]/, '').length _bind_decimal(index, lower, upper, width, decimal.scale) end