0

New to ruby here - getting an error about bind parameters in my db_add_notice method. Having trouble googling this error for some reason. Can someone point out what's wrong? Thanks.

./check.rb:57:in `db_add_notice' is calling SQLite3::Database#execute with nil or multiple bind params without using an array. Please switch to passing bind parameters as an array. Support for bind parameters as *args will be removed in 2.0.0.

...
# add a usn entry to the datase
def db_add_notice(db, usn_number, href, title, description)
   db.execute("INSERT INTO usn_notice (usn_number, href, title, description) VALUES (?,?,?,?)", usn_number, href, title, description)
end
...
db_add_notice(db, usn_number, href, title, description)
...
Koko
  • 459
  • 4
  • 14
  • Have you tried passing the variables in an array, that is, `db.execute("INSERT INTO usn_notice (usn_number, href, title, description) VALUES (?,?,?,?)", [usn_number, href, title, description])`? – moveson Nov 20 '17 at 22:31
  • Ah, that works. Thank you! – Koko Nov 21 '17 at 13:59

0 Answers0