【问题标题】:Anorm Mysql Stored Procedure callingAnorm Mysql 存储过程调用
【发布时间】:2016-03-02 06:58:43
【问题描述】:

这是我的简单存储过程,

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 中运行存储过程

【问题讨论】:

    标签: mysql scala stored-procedures playframework anorm


    【解决方案1】:

    这对我有用

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-15
      • 1970-01-01
      • 2017-04-23
      • 2016-05-03
      • 2013-05-18
      • 2011-05-05
      相关资源
      最近更新 更多