18 lines
380 B
MySQL
18 lines
380 B
MySQL
|
DELIMITER $$
|
||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`unary_insert`(OUT v_unary INT, v_parent INT)
|
||
|
BEGIN
|
||
|
|
||
|
/**
|
||
|
* Inserta un nuevo nodo. Se puede indicar el padre.
|
||
|
*
|
||
|
* @v_parent: Nodo padre.
|
||
|
* @v_unary: Id del nuevo nodo.
|
||
|
**/
|
||
|
|
||
|
INSERT INTO unary(parent) VALUES(v_parent);
|
||
|
|
||
|
SELECT last_insert_id() INTO v_unary;
|
||
|
|
||
|
END$$
|
||
|
DELIMITER ;
|