You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to build a physical table downloading service.
I am having problems when trying to process SQL Server DATETIME fields in this way.
I am experincing the following error when running the following code: sql: Scan error on column index 8: unsupported driver -> Scan pair: time.Time -> *[]uint8
I have looked around and it seems this is an issue other drivers have encountered, but I can't point at a specific solution.
Being able to assign a datetime value through Scan() would be extremely useful.
// Create and run the database query.query, err:=dbConnection.Query("SELECT * FROM table")
iferr!=nil {
log.Fatal(err)
}
deferquery.Close()
// Get the queries columnscols, err:=query.Columns()
iferr!=nil {
log.Fatal(err)
}
// Byte data (so NULL fields can be handled later)byteData:=make([][]byte, len(cols))
// Interface for the scandestination:=make([]interface{}, len(cols))
// Assign the destination interface points to the byte data.fori, _:=rangebyteData {
destination[i] =&byteData[i]
}
// Parse query results.forquery.Next() {
err:=query.Scan(destination...)
iferr!=nil {
log.Fatal(err) // Bombing out here.
}
}
The text was updated successfully, but these errors were encountered:
I am attempting to build a physical table downloading service.
I am having problems when trying to process SQL Server DATETIME fields in this way.
I am experincing the following error when running the following code:
sql: Scan error on column index 8: unsupported driver -> Scan pair: time.Time -> *[]uint8
I have looked around and it seems this is an issue other drivers have encountered, but I can't point at a specific solution.
Being able to assign a datetime value through
Scan()
would be extremely useful.The text was updated successfully, but these errors were encountered: