我正在使用库和驱动程序,但在插入新行时github.com/denisenkom/go-mssqldb出现错误。sql: expected 0 arguments, got 3 exit status 1
tsql := "INSERT INTO Uploads (Fname, Fsize, Ftype) VALUES (@Fname, @Fsize, @Ftype );"
fmt.Printf("tsql = %s\n", tsql)
//Execute non-query with named parameters
res, err := db.ExecContext(
ctx,
tsql,
sql.Named("Fname", fname),
sql.Named("Fsize", fsize),
sql.Named("Ftype", ftype))
if err != nil {
log.Fatal(" AddRow_v1() -> Error creating new row: " + err.Error())
return -1, err
}
catspeake
相关分类