Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Anorm Mysql存储过程调用_Mysql_Scala_Stored Procedures_Playframework_Anorm - Fatal编程技术网

Anorm Mysql存储过程调用

Anorm Mysql存储过程调用,mysql,scala,stored-procedures,playframework,anorm,Mysql,Scala,Stored Procedures,Playframework,Anorm,这是我的简单存储过程 DELIMITER $$ USE `TestDB`$$ DROP PROCEDURE IF EXISTS `test123`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `test123`(id INT(11) , user_name VARCHAR(15), branch VARCHAR(15)) BEGIN INSERT INTO Testlog(id,user_name,branch) VALUES(id,user

这是我的简单存储过程

DELIMITER $$

USE `TestDB`$$

DROP PROCEDURE IF EXISTS `test123`$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `test123`(id INT(11) , user_name VARCHAR(15), branch VARCHAR(15))
BEGIN
INSERT INTO Testlog(id,user_name,branch)
VALUES(id,user_name,branch);
END$$

DELIMITER ;
我可以在mysql中使用下面的命令运行上面的存储过程

CALL `TestDB`.test123(3,"swap","desc")
但使用anorm如何做到这一点

DB.withConnection { implicit c =>
SQL("EXCE  test123 {id},{name},{branch}").
on('id -> 22,
'name -> "lcs",
'branch -> "desc").executeQuery()

}
如何在Anorm中运行存储过程这对我很有用

SQL("call  test123 ({id},{name},{branch})").
          on('id -> 21,
            'name -> "lcs",
            'branch -> "desc").executeUpdate()

}