如何从 SQuirreL SQL 调用带有 OUT 参数的 DB2 存储过程? [英] How can I call a DB2 stored procedure with OUT parameters from SQuirreL SQL?

查看:15
本文介绍了如何从 SQuirreL SQL 调用带有 OUT 参数的 DB2 存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很喜欢将 SQuirreL SQL 作为 SQL 查询工具,但是我从来没有能够让它调用我们的 AS/400 DB2 数据库中的存储过程.我总是收到错误设置或注册的参数值的数量与参数的数量不匹配".我已经仔细检查了参数的数量并且没有运气.这是我为一个需要一个 IN 和一个 OUT 的过程尝试过的语法:

I really like SQuirreL SQL as a SQL query tool, but I've never been able to get it to call stored procedures in our AS/400 DB2 database. I always get the error "The number of parameter values set or registered does not match the number of parameters." I've double-checked the number of params and had no luck. This is the syntax I've tried for a procedure that takes one IN and one OUT:

调用 SOMESPROC(12345, ?);

call SOMESPROC(12345, ?);

推荐答案

目前 SQuirrel 似乎无法在 AS/400 DB2 上做到这一点.

It seems that SQuirrel currently is not capable of doing that on AS/400 DB2.

使用开源SQL Workbench/J"(http://www.sql-workbench.net/) 我能够调用一个过程:

Using the open source "SQL Workbench/J" (http://www.sql-workbench.net/) I was able to call a procedure:

wbcall SOMESPROC(12345, ?);

它有自己的命令来调用过程wbcall".利用 ?输出参数.

It has its own command for calling a procedure "wbcall". Use ? for out parameters.

注意:安装 SQL Workbench/J 时,请确保从 IBM 并在 SQL Workbench/J 中添加驱动程序时添加许可证文件.

Note: While installing SQL Workbench/J make sure to download the right DB2 driver from IBM and also add the licence file while adding the driver inside SQL Workbench/J.

这篇关于如何从 SQuirreL SQL 调用带有 OUT 参数的 DB2 存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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