cfscript 中的 addstoredproc 方法出错

发布于 2024-12-23 17:18:13 字数 527 浏览 2 评论 0原文

我正在使用 cfscript 调用存储过程,但是当我将 addProcResult 方法添加到调用中时,ColdFusion 返回错误结构中不存在指定的键、结果。 删除该方法可以修复错误并且不会影响结果,但我仍然想知道为什么会出现错误。使用 不会生成错误。我正在运行CF9。我的代码如下。

spService = new storedProc();
spService.setDatasource("mydb");
spService.setProcedure("someSP");
spService.setUsername("TaskRunner");
spService.setPassword("password");
spService.addProcResult(name="result",resultset=1);
spService.execute();

I am calling a stored procedure with cfscript, but when I add the addProcResult method to the call, ColdFusion returns the error The specified key, result, does not exist in the structure. Removing the method fixes the error and doesn't effect the results, but I still would like to know why the error appeared. Using <cfstoredproc> and <cfprocparam> doesn't generate the error. I am running CF9. My code is below.

spService = new storedProc();
spService.setDatasource("mydb");
spService.setProcedure("someSP");
spService.setUsername("TaskRunner");
spService.setPassword("password");
spService.addProcResult(name="result",resultset=1);
spService.execute();

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情泪▽动烟 2024-12-30 17:18:13

如果您的存储过程实际上不返回结果集(可能它返回一个输出参数,或者根本不返回任何内容),您将收到此错误。

只需删除对 .addProcResult() 的调用,就可以了。

You'll get this error if your stored procedure actually doesn't return a resultset (perhaps it returns an output parameter--or nothing at all).

Simply remove the call to .addProcResult(), and you'll be fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文