Re: IF ELSE
Barry:
OK, I have changed the code somewhat as below:
DELIMITER //
drop procedure IF EXISTS CountIN ;
create procedure CountIN (@cnt 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 //
DELIMITER ;
I am now getting 2 error messages:
1) The code won't stop
2) The commands are out of sync.
Any ideas?
Subject
Written By
Posted
Re: IF ELSE
March 22, 2023 07:21PM
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.