Untitled
user_4655978
golang
a year ago
427 B
6
Indexable
func updateLotto(db *sqlx.DB) error {
query := "UPDATE documenti SET lotto = ? WHERE id IN (?)"
query, args, err := sqlx.In(query, "ID01", []string{"val01", "val02"})
query = db.Rebind(query)
// args così come è restituito da sqlx.In è []interface{"ID01", "val01", "val02"}
_, err = db.Exec(query, args...) // sql: converting argument $1 type: unsupported type []interface {}, a slice of interface
return nil
}Editor is loading...
Leave a Comment