FAQ
If there is a more current/widely accepted ODBC driver I should be using
instead, please let me know.

I am using go-odbc in a project and have run into a problem. Some varchar
fields will not display any contents even though they are not empty.

// First, update all production machines' last-seen location
conn,_ := odbc.Connect("DSN=xxx;UID=xxx;PWD=xxx")
defer conn.Close()
stmt,_ := conn.ExecDirect("SELECT * FROM machine_locations")

locs,_ := stmt.FetchAll()

for i,loc := range locs {
fmt.Println(i,loc.Length(),loc.Data[1])
}

In this case, loc.Data[1] is a varchar(35) field, and will not display
anything for any of the rows. However, right after it is a varchar(25)
field, and it displays fine. Am I missing something here?

--

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 4, '12 at 2:33p
activeDec 4, '12 at 2:33p
posts1
users1
websitegolang.org

1 user in discussion

Tim Dufrane: 1 post

People

Translate

site design / logo © 2021 Grokbase