如何在存储过程的相同功能中将插入的值 id 插入到另一个表中?
例如:
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;