How to insert the inserted value id into another tables in same function of stored procedure?
For example:
CREATE PROCEDURE p1(IN id_val INT, IN name_val VARCHAR(255))
BEGIN
DECLARE @iJobID [INT]
SET @iJobID=(INSERT INTO test(id, name) VALUES(id_val, name_val));
INSERT INTO vasu(id) VALUES(@iJobID);
END;
you can use
LAST_INSERT_ID()to get the last inserted ID and set it on the local variable.