Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

查询MSSQL GUID截断问题 #19

Open
forrestsun opened this issue Jun 23, 2015 · 1 comment
Open

查询MSSQL GUID截断问题 #19

forrestsun opened this issue Jun 23, 2015 · 1 comment

Comments

@forrestsun
Copy link

conn, _ := odbc.Connect(connstr)
    sql := "select CLASS_ID,CLASS_NAME from COMM_RES_CLASS where CLASS_PID='" + media_guid + "' order by CREATE_TIME"
    stmt, _ := conn.Prepare(sql)
    stmt.Execute()
    rows, _ := stmt.FetchAll()
    stmt.Close()
    for _, row := range rows {
        fmt.Println(row.GetString(0))
    }

    conn.Close()

结果中的36位guid编码被截断了,请问如何处理?

@shawnye
Copy link

shawnye commented Sep 30, 2016

你看看 COMM_RES_CLASS 定义 CLASS_ID 是不是小于36*2=72个字符, 建议定义为 varchar(72)或更大,这似乎是go-odbc的bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants