I'm using the ODBC driver from The Brainman. I'm using the generic ODBC syntax, which is to use "CALL" to invoke a Stored Procedure. Here is my code:
stmt, stmtErr := db.Prepare("CALL RecordClick (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")
if stmtErr != nil {
fmt.Printf("
stmtErr: %s", stmtErr)
}
defer stmt.Close()
var aclickid int
stmtRows, stmtRowsErr := stmt.Query(xaid, subtag, r.Referer, requestUserAgent, requestIP, ip, ua, title, description, displayurl, clickUrl, kw, rpc, exid)
if stmtRowsErr != nil {
fmt.Printf("
stmtRowsErr: %s", stmtRowsErr)
}
for stmtRows.Next() {
stmtRows.Scan(&aclickid)
}
When I run this, I get the following error:
stmtRowsErr: sql: converting Exec argument #2's type: unsupported type func() string, a func
I really don't understand what I'm doing wrong here. I've tried it with and without curly braces around the CALL XXX (?, ?, ?) part, and it still won't work. Any ideas?
Thanks.