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)
declare erro text;
declare exit handler for sqlexception
get diagnostics condition 1 erro = message_text, p_cod_erro = returned_sqlstate;
set p_msg_erro = cast(replace(erro, '''', '''''') as char(255));

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;

The error appears to be in the exit handler group.
Thanks in advance.

Options: ReplyQuote

Written By
Error in procedure only throught ODBC connection
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.