|
Derek Tracy |
at Nov 14, 2012 at 7:32 pm
|
⇧ |
| |
I did find a work around.
If I cast the bigint to varchar(max) in the select the odbc driver
correctly converts that to an int64
"SELECT TOP 100 CAST(Id VARCHAR(MAX)) FROM Catalog"
Still would like to figure out why the bigint is being put into scientific
notation in the first place
On Wed, Nov 14, 2012 at 2:29 PM, Derek Tracy wrote:Forgot to reply-to-all
---------- Forwarded message ----------
From: Derek Tracy <
tracyde@gmail.com>
Date: Wed, Nov 14, 2012 at 1:36 PM
Subject: Re: [go-nuts] Re: odbc ParseInt errors
To: Luke Mauldin <
lukemauldin@gmail.com>
I am running this Go program on a Linux box, so I don't think lodbc would
work since it uses SYSCALL
---------------------------------
Derek Tracy
tracyde@gmail.com---------------------------------
On Wed, Nov 14, 2012 at 1:29 PM, Luke Mauldin wrote:Have you tried using
https://github.com/LukeMauldin/lodbc/On Wednesday, November 14, 2012 12:14:36 PM UTC-6, Derek Tracy wrote:
I am running into an issue with both go-odbc and mgodbc
Error occured reading row: sql: Scan error on column index 0:
converting string "1.005998e+06" to a int64: strconv.ParseInt: parsing
"1.005998+06
I am hitting a SqlServer 2008 db and the column type I am trying to
pull is bigint. I can scan the rows fine when the value returned is below
1000000
db, err := sql.Open("mgodbc", dsn)
defer db.Close()
stmt, err := db.Prepare("SELECT TOP 100 Id FROM Catalog")
defer stmt.Close()
rows, err := stmt.Query()
defer rows.Close()
for rows.Next() {
var id int64
err = rows.Scan(&id)
log.Printf("Id: %d\n", id)
}
I was first using int instead of int64 but did not make a difference.
What am I doing wrong?
--
--