1. 首页
  2. 主题
  3. Go语言

SQL数据库为BIGINT时,插入数据库出错type: unsupported type big.Int

admin87 · · 2532 次点击
rows,err := app.PLADB.Query("SELECT TOP 1 convert(bigint,ID) AS [FSourceInterID] FROM History") if err != nil { return } defer rows.Close() var s interface{} for rows.Next() { err = rows.Scan(&s) if err != nil { panic(err) } fmt.Printf("x is of type %T\n", s) fmt.Println(s) } log.Println(app.PLADB.Query("insert into t(id) values (?)",s)) 查出来的是bigint类型。然后在插入时,出错 2018年05月05日 14:29:34 <nil> sql: converting argument 1ドル type: unsupported type big.Int, a struct 以下是输出的类型与值 s is of type *big.Int 17121111112102 请指教,这个如何处理
convert(bigint,ID) 是干嘛的?不转不行?
#1
更多评论
找到解决法 了,就是取数据,把BIGINT转为INT64 谢谢
#2

用户登录

没有账号?注册

今日阅读排行

    加载中

一周阅读排行

    加载中