Error in procedure only throught ODBC connection
Does anybody knowns why this code work throught command line with mysql.exe, but it doesn't work throught ODBC connection:
create procedure executa_comando (IN p_comando text,
OUT p_cod_erro varchar(5),
OUT p_msg_erro varchar(255),
OUT p_qtde_regs int)
begin
declare erro text;
declare exit handler for sqlexception
begin
get diagnostics condition 1 erro = message_text, p_cod_erro = returned_sqlstate;
set p_msg_erro = cast(replace(erro, '''', '''''') as char(255));
end;
set p_cod_erro = '00000';
set p_msg_erro = '';
set @cmd = p_comando;
prepare stmt from @cmd;
execute stmt;
select row_count() into p_qtde_regs;
deallocate prepare stmt;
end;
The error appears to be in the exit handler group.
Thanks in advance.
Subject
Views
Written By
Posted
Error in procedure only throught ODBC connection
1463
December 28, 2016 06:34AM
656
December 28, 2016 10:01AM
714
December 28, 2016 10:37AM
653
December 28, 2016 01:12PM
706
December 28, 2016 02:29PM
Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.