Skip to content

tds.Num into type *sql.RawBytes #20

@ashf

Description

@ashf

I am querying a table I don't know the schema of. So I am using this to gather the table contents:

cols, err := rows.Columns() // Remember to check err afterwards
vals := make([]interface{}, len(cols))
for i, _ := range cols {
	vals[i] = new(sql.RawBytes)
}

for rows.Next() {
	if err := rows.Scan(vals...); err != nil {
        // Check for a scan error.
	// Query rows will be closed with defer.
	log.Fatal(err)
	}
	log.Info(vals)
}

However when I get to a column with type money I get the following error:

unsupported Scan, storing driver.Value type tds.Num into type *sql.RawBytes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions