我有多个参数的问题,我无法用sql查询实现2个参数。而且我仍然收到错误,错误显示mssql:“SequenceID”附近的语法不正确。我的查询sql有什么问题,或者我的代码有什么问题?packagemainimport("database/sql""fmt"_"github.com/denisenkom/go-mssqldb""github.com/gin-gonic/gin""net/http""time")funcmain(){db,err:=sql.Open("sqlserver","sqlserver://sa:@localhost:1433?database=CONFINS&
我在实现2个这样的参数时遇到问题:http://localhost:8080/SMSBlast/SequenceID?SequenceID=2&MobilePhone=85261415223如何查询两列SequenceID和MobilePhone得到SequenceID=2&MobilePhone=85261415223,我试了很多方法还是不行packagemainimport("database/sql""fmt"_"github.com/denisenkom/go-mssqldb""github.com/gin-gonic/gin""net/http""time")funcmain
我的代码有问题,我正在使用库GORM创建数据或将数据插入到我的restfulapi,打印错误如下所示:(mssql:ViolationofPRIMARYKEYconstraint'PK_SMSBlast2'.无法在其中插入重复键对象'dbo.SMSBlast2'。重复键值为(0)。)主要包import("encoding/json""fmt""github.com/gorilla/mux""github.com/jinzhu/gorm"_"github.com/jinzhu/gorm/dialects/mssql""log""net/http""time")键入SMSBlast结构{序
我现在正在尝试restfulapi,其中列SequenceID不是自动增量,因为故意的,当我像这样计数时,我的问题是库gormcountSequenceId:=db.Debug().Table("SMSBlast2").Count(&smsblast1),结果是sql:列索引0上的扫描错误,名称“”:不支持的扫描,将driver.Value类型int64存储到类型*main.SMSBlastpackagemainimport("encoding/json""fmt""github.com/gorilla/mux""github.com/jinzhu/gorm"_"github.com/