MySQL Forums
Forum List  »  Newbie

Re: IF ELSE
Posted by: Michael Smith
Date: March 22, 2023 01:34PM

Barry:

I have significantly changed this code and it is cleared with MYSQL Workbench but it gives the error message that the procedure CountIN alreday exists

DELIMITER //

drop procedure IF EXISTS CountIN ;

DELIMITER //

create procedure CountIn (ccnt INT)


BEGIN
SELECT COUNT(ITEM) INTO @cnt FROM Invoices01 WHERE invnbr > 0;

IF @cnt = 0 THEN SELECT @mnewnumber := Nextra5 from Storage01 ;
update Invoices01 set invnbr = @mnewnumber;
END IF;

END //

drop procedure IF EXISTS CountIN (ccnt INT)

DELIMITER ;

Any suggestions?

Mike

Options: ReplyQuote


Subject
Written By
Posted
March 15, 2023 03:31PM
March 19, 2023 12:56AM
Re: IF ELSE
March 22, 2023 01:34PM
March 22, 2023 05:02PM
March 22, 2023 07:21PM
March 23, 2023 01:54AM
March 26, 2023 06:24PM


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.