I am new to Golang (but not on HANA), and I am trying to test out the go-hdb to pull out data from TCURR table (from HANA DB SPS6). From what I understand is in that table, UKURS, FFACT, and TFACT are all Decimals in HANA DB. However when retrieving from Go, which I tried fetch using row.Scan to Float64 like this:
var mandt, kurst, fcurr, tcurr, gdatu, datum string
var ukurs float64
var ffact, tfact float64
if err := rows.Scan(&mandt, &kurst, &fcurr, &tcurr, &gdatu, &ukurs, &ffact, &tfact, &datum); err != nil {
log.Fatal(err)
}
But alas, getting error like this
2016/08/18 10:18:31 sql: Scan error on column index 5: converting driver.Value type []uint8 ("@\xe2\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0060") to a float64: invalid syntax
I try to read and understand the error it looks like needs uint8 data type (or byte), however, I am stuck with how to convert those uint8/byte into string.
Is there anyone have this problem before and how to getting decimal data and displayed it properly (ie print them into console)?