Scan error on column index, name \"CREATED_TIME\": unsupported Scan, storing driver.Value type go_ora.TimeStamp into type *sql.RawBytes

Viewed 19

I am trying to fetch values dynamically from the database using golang. But one of the columns type is timestamp, So I'm getting an error says "Scan error on column index 3, name "CREATED_TIME": unsupported Scan, storing driver.Value type go_ora.TimeStamp into type *sql.RawBytes"

cnxt := context.Background()

rows, rowsError := dbConn.QueryContext(cnxt, query)
defer rows.Close()

if rowsError != nil {
    return
}

columns, columnError := rows.Columns()

if columnError != nil {
    return
}

var resultSet = []string{}
values := make([]interface{}, len(columns))
row := make(map[string]interface{})
for i := range columns {
    values[i] = new(sql.RawBytes)
}

for rows.Next() {
    rowsScanError := rows.Scan(values...)
    if rowsScanError != nil {
        // getting error here
    } 
0 Answers
Related