MySQL Forums
Forum List  »  German

Re: warum funktioniert mein Cursor nicht so wie er soll
Posted by: Andre Termath
Date: February 27, 2019 09:32AM

Inzwischen funktioniert er, trotzdem schließt die Procedure fehlerhaft ab

"Error 1329 - No data - zero rows fetched, selected, or processed"

Was sagt mir das? Google hat mir noch keine Hilfe gebracht.

##drop PROCEDURE proc_Artikelanlage;

DELIMITER $$

create PROCEDURE proc_Artikelanlage ()
BEGIN

DECLARE v_externe_Artikelnr varchar(255) DEFAULT '';
DECLARE Zaehler INT DEFAULT 0 ;
DECLARE done INT DEFAULT 0;

-- declare cursor for employee email
DEClARE cursor_Excel CURSOR FOR
select externe_artikelnummer from SCM_Artikelanlage
;



OPEN cursor_Excel;

set zaehler = 1;
Repeat

FETCH cursor_Excel INTO v_externe_Artikelnr;
if not done then
update SCM_Artikelanlage set fertig = 1, fertig_am = now() , nummerierung_für_zusammenführung = Zaehler where externe_artikelnummer = v_externe_Artikelnr COLLATE utf8_general_ci;
set Zaehler = Zaehler+1;
DO SLEEP(2);
end if;
UNTIL done END REPEAT;

CLOSE cursor_Excel;

END$$

DELIMITER ;



CALL proc_Artikelanlage();

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: warum funktioniert mein Cursor nicht so wie er soll
307
February 27, 2019 09:32AM


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.