There is an old MSSQL database and I need to make contact with it. The connection to it happens without any problems, but some kind of trouble happens with requests. There is a table [Employees] with the fields: id, Name, E-mail and for example, I need to pull out the name knowing only the mail. This is what my method looks like:
func (w *Wrapper) GetAuthorInIntexOrder(email string) (string) { row := IntexDB.QueryRow("SELECT Name FROM [Сотрудники] WHERE [E-mail] = $1", email) var name string err := row.Scan( &name, ) if err != nil { log.Warn("[database]GetAuthorInIntexOrder->row.Scan: ", err.Error()) return "" } return name } In response, I get the error: "[database]GetAuthorInIntexOrder->row.Scan: mssql: Cannot convert a char value to money. The char value has incorrect syntax." Name is nvarchar type and I don’t understand why money is being converted at all, it's just a string. I use the github.com/denisenkom/go-mssqldb driver. It is interesting that if we remove the WHERE condition, the query will be executed and I will get the 1st element in the table. What do you think could be the problem?
money- Denis Rubashkin Februaryrow := IntexDB.QueryRow("SELECT Name FROM [Сотрудники] WHERE [E-mail] = '$1' ", email)- Akina... илиrow: = IntexDB.QueryRow ("SELECT Name FROM [Employees] WHERE [E-mail] = '?'", email) `... - Akina