18 lines
380 B
SQL
18 lines
380 B
SQL
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 ;
|