MySQL Forums
Forum List  »  Portuguese

Utilizando cursores
Posted by: Marco Antonio borges
Date: June 22, 2021 01:51PM

OLA GENTE BOA TARDE. DESCULPA O POST SIMPLES, MAS TO QUEBRANDO A CABEÇA NISSO QUE E SIMPLES MAS NAO TA ROLANDO.

ALGUÉM PODERIA ME DIZER O QUE HA DE ERRADO ?

declare

CURSOR c1 is

select cnae_code, mcc_code from sistema.cnae_mcc;

BEGIN

open x in c1 ;

loop

update sistema.company set mcc_code = x.mcc_code where cnae_code = x.cnae_code;



end loop;

commit;

END;


ERRO

Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare CURSOR c1 is select cnae_code, mcc_code from sistema.cnae_mcc' at line 1 0,020 sec

Options: ReplyQuote


Subject
Views
Written By
Posted
Utilizando cursores
451
June 22, 2021 01:51PM


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.