I was working on a golang project, I've used a postgres database to store data with some Stored Procedure.
I used github.com/jinzhu/gorm for connecting to the database.
I used below query to retrieve data. I know in postgres we are unable to use select, so I only tried insert code in SP.
db.Database.Raw("CALL mydatabase.mystoredprocedure('" + param1 + "','" + param2 + "')")
db.Database.Raw("SELECT * FROM table1").Scan(&tableValue)
But here I'm only able to call a SELECT statement, not able to call the stored procedure.
Please, can any one help me to solve this problem?
Thanks in advance
SELECT. Also your procedure call is subject to sql injection, you might want to be more careful.