第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Golang mssql 驅(qū)動(dòng)程序返回“mssql:無(wú)效的對(duì)象名稱”

Golang mssql 驅(qū)動(dòng)程序返回“mssql:無(wú)效的對(duì)象名稱”

Go
繁星點(diǎn)點(diǎn)滴滴 2021-11-01 16:11:33
在一個(gè)應(yīng)用程序中,我有一個(gè)全局范圍的var db *sql.DB后來(lái)被稱為slcstrSource, slcint64Timestamp, slcstrContent, err := DB_functions.GetContent(db)            if err != nil {                 fmt.Println("Error: " + err.Error())            }GetContent 是這樣的:func GetContent(db *sql.DB) ([]string, []int64, []string, error) {    var slcstrContent []string    var slcint64Timestamp []int64    var slcstrSource []string    // Run the query    rows, err := db.Query("SELECT source, timestamp, content FROM MyDatabase.MyTable")    if err != nil {            return slcstrSource, slcint64Timestamp, slcstrContent, err    }    defer rows.Close()    for rows.Next() {            // Holding variables for the content in the columns            var source, content string            var timestamp int64            // Get the results of the query            err := rows.Scan(&source, &timestamp, &content)            if err != nil {                    return slcstrSource, slcint64Timestamp, slcstrContent, err            }            // Append them into the slices that will eventually be returned to the caller            slcstrSource = append(slcstrSource, source)            slcstrContent = append(slcstrContent, content)            slcint64Timestamp = append(slcint64Timestamp, timestamp)    }    return slcstrSource, slcint64Timestamp, slcstrContent, nil}當(dāng)我運(yùn)行應(yīng)用程序并命中這些代碼部分時(shí),我得到:Error: mssql: Invalid object name 'MyDatabase.MyTable'.當(dāng)我 db.Ping() 數(shù)據(jù)庫(kù)時(shí),它似乎工作。從我縮小范圍來(lái)看,錯(cuò)誤發(fā)生在查詢中,但我找不到問(wèn)題所在。我檢查了數(shù)據(jù)庫(kù),有一個(gè)名為 MyDatabase 的數(shù)據(jù)庫(kù),其中有一個(gè)名為 MyTable 的表,該表在這三列中有信息......在進(jìn)行查詢之前或進(jìn)行查詢時(shí),我是否遺漏了什么?
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 268 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)