MySQL Forums :: InnoDB :: Error in procedure only throught ODBC connection


Advanced Search

Error in procedure only throught ODBC connection
Posted by: Renato renato ()
Date: December 28, 2016 06:34AM

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.

Options: ReplyQuote


Subject Views Written By Posted
Error in procedure only throught ODBC connection 273 Renato renato 12/28/2016 06:34AM
Re: Error in procedure only throught ODBC connection 141 Peter Brawley 12/28/2016 10:01AM
Re: Error in procedure only throught ODBC connection 181 Renato renato 12/28/2016 10:37AM
Re: Error in procedure only throught ODBC connection 144 Peter Brawley 12/28/2016 01:12PM
Re: Error in procedure only throught ODBC connection 142 Renato renato 12/28/2016 02:29PM


Sorry, only registered users may post in this forum.

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.