如何在 IBM System i Access for Windows GUI Tool 中调用存储过程
我想测试在 AS400 系统上运行的 DB2 存储过程。
我安装了 IBM System i Access for Windows,并且可以针对 DB2 数据库运行 SQL 命令。
我的问题是:执行接受参数并返回结果作为输出参数并将值打印到屏幕的存储过程的语法是什么?
只是为了澄清:我不是问如何在代码中调用过程。我想执行过程并在gui工具(类似于SQL Enterprise Manager)中查看结果。
I would like to test a DB2 stored procedure running on an AS400 system.
I have the IBM System i Access for Windows installed and can run SQL commands against the DB2 database.
My question is: What is the syntax to execute a stored procedure that takes in a parameter and returns a result as an output parameter and print the value to the screen?
Just to clarify: I am not asking how to call the proc in code. I want to execute the proc and see the results in the gui tool (which is similar to SQL Enterprise Manager).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用关键字
call
并传入参数。有关更多详细信息,请参阅此处 http://www.ibm.com/developerworks /data/library/techarticle/dm-0503melnyk/。有趣的部分是图 5. 使用命令编辑器调用 SQL 过程
use the keyword
call
and pass in the parameters.for more details see here http://www.ibm.com/developerworks/data/library/techarticle/dm-0503melnyk/. The interesting part is Figure 5. Using the Command Editor to call an SQL procedure
你想要的都是可能的。我自己已经做过很多次了。不幸的是,我现在不在办公室,所以这一定是我的想法。
另请注意,
非常重要:我从未能够在 iSeries 本身上使用 SQL 编辑器 (STRSQL) 测试 SP。只有 iAccess SQL 编辑器可以正常工作。
What you want is possible. I have done it myself many times. Unfortunaly, I'm not at the office right now so it must be from the top of my head.
On an additional note,
VERY IMPORTANT: I was never able to test the SP with the SQL editor (STRSQL) on the iSeries itself. Only the iAccess SQL editor did work correctly.
你应该能够像这样运行你的SP:
或者你可以使用EXECUTE,但它不能动态准备(不在Java中运行),我认为还有一些其他缺点。
You should be able to run your SP like this:
Or you can use EXECUTE, but it can't be dynamically prepared (not run in Java) and I think there's some other disadvantages.