[英]How to use Oracle stored procedures with Scala Anorm in Playframework
I have many stored procedures which have Lists of Strings as result 我有许多存储过程,其中包含字符串列表
How can i access the refcurser in the play 2.0 Framework with scala? 如何使用scala访问play 2.0 Framework中的递归?
Can someone make a simple example how i can fill a list? 有人可以举一个简单的例子来说明我如何填写清单吗?
I tried this: 我试过这个:
case class XXXX(name: String, description: String)
object XXXX{
val simple = {
get[String]("name") ~
get[String]("description") map {
case name~description => XXXX(name, description)
}
}
def all(): List[XXXX] = DB.withConnection { implicit c =>
SQL("""exec PROCEDURE""").as(XXXX.simple *)
}
}
But this is not working for me 但这不适合我
thanks in advance 提前致谢
EDIT: Is it even possible to fill a List from a stored procedure? 编辑:甚至可以从存储过程填充列表?
List of strings would correspond to oracle user defined objects. 字符串列表将对应于oracle用户定义的对象。 I hope that is what you mean.
我希望这就是你的意思。 Possible solutions are 1) First Map the oracle collection object and then use in scala code or 2) return a ref cursor from stored proc instead of collection.
可能的解决方案是1)首先映射oracle集合对象然后在scala代码中使用或2)从存储的proc而不是集合返回引用游标。
Hope this gives some idea. 希望这能给出一些想法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.