MySQL Forums
Forum List  »  Stored Procedures

Re: Stored Proceedure Not doing anything...?
Posted by: Peter Brawley
Date: June 02, 2018 02:44PM

-- set _new_product_id2 = (SELECT MAX(`ProductID`) FROM `products`)+1;

Is it auto_increment? Then leave it out of the column Insert list, let MySQL handle it.

> SET _new_product_id = (SELECT MAX(`ProductID`) FROM `products`);

Wrong, use Last_Insert_Id().

Still no error handling.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Stored Proceedure Not doing anything...?
503
June 02, 2018 02:44PM


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.