I have the simple query in Go:
import "database/sql"
Db, err := sql.Open(...)
p1 := "string param"
Db.QueryRow("select * from some_func(?)", p1)
The some_func
accepts string param. In terms of PGsql it is a single-quoted text: 'some val'
.
To achieve passing single quoted param I did the following: Db.QueryRow("select * from some_func('?')", p1)
. I’ve wrapped ?
with single quotes. But I’m getting error: 1 parameter is passed when expecting 0