如何在 H2 中创建程序 [英] How to CREATE PROCEDURE in H2

查看:29
本文介绍了如何在 H2 中创建程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎与另一个标题相同的问题重复,但实际上并非如此.

This seems to be a duplicate of the other question with the same title, but it actually isn't.

我们的业务逻辑主要实现为 DB2 存储过程(我看到 H2 具有 DB2 兼容模式 - 很好!).

We have our business logic implemented mostly as DB2 stored procedures (I see that H2 has a DB2-compatibility mode - nice!).

我们如何通过这些程序使用 H2 进行内存单元测试?

How can we use H2 for in-memory unit testing with these procedures?

不幸的是,H2 似乎缺少其 语法 中的 CREATE PROCEDURE 命令.

Unfortunately H2 seems to lack the CREATE PROCEDURE command from its grammar.

我不想将 Java 函数用作 存储过程.如果同样的 sql 文件也可以用于测试和生产,那将是最好的……我要求太多了吗?

I don't want to use Java functions as stored procedures. It would be best if the very same sql files could be used for testing and production as well... am I asking too much?

我们也使用 SQL 游标...再次,没有支持的迹象 :-(

we also use SQL cursors... again, no sign of support :-(

推荐答案

不幸的是,兼容模式并没有达到支持 SQL 程序的程度.目前,唯一的解决方案是使用 Java 函数.也不支持 SQL 游标,抱歉.但我会将这些功能请求添加到路线图中.当然欢迎补丁:-)

Unfortunately, the compatibility mode doesn't go as far as supporting SQL prodecures. Currently, the only solution is to use Java functions. SQL cursors are also not supported, sorry. But I will add these feature requests to the roadmap. Patches are welcome of course :-)

这篇关于如何在 H2 中创建程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆