Method: SQLite::Database#get_first_value

Defined in:
lib/sqlite/database.rb

#get_first_value(sql, *bind_vars) ⇒ Object

A convenience method for obtaining the first value of the first row of a result set, and discarding all other values and rows. It is otherwise identical to #execute.

See also #get_first_row.



275
276
277
278
# File 'lib/sqlite/database.rb', line 275

def get_first_value( sql, *bind_vars )
  execute( sql, *bind_vars ) { |row| return row[0] }
  nil
end