MySQL Forums
Forum List  »  InnoDB

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
1397
December 28, 2016 06:34AM


Sorry, you can't reply to this topic. It has been closed.

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.