I'm having a problem getting the return of a procedure using golang. If I remove the parameters from the procedure the procedure is executed normally, however, when I need to get the return (OUT parameter) I can not get it and the procedure is not executed. To make the tests simpler and to get help, I created a simple procedure as below and I want to get the return of it.
Follow procedure below:
drop procedure if exists PESSOA_TESTE;
delimiter $$
create procedure PESSOA_TESTE(out psaida int)
begin
set psaida = 2;
end
$$
Now it follows the section of golang code that I'm using to try to get the value 2 specified in the procedure.
var GerenciaBD GERENCIABD
var PontoExecucao int
GerenciaBD.F_GERENCIABD_ABRIR_CONEXAO_MYSQL()
GerenciaBD.DataBase.ExecContext(context.TODO(),"call PESSOA_TESTE", sql.Named("psaida", sql.Out{Dest:&PontoExecucao}))
println(PontoExecucao)
When executing I have as answer 0 and not 2, which is the one specified in the procedure.
My golang version is at 1.10.