say i have a stored procedure in mysql like below
-- ---------------------------- -- Procedure structure for usp_insert_user_basic_info -- ------------------
You can get last insert id like this in SP:
DECLARE LID int; SET LID = LAST_INSERT_ID();