cfscript 中的 addstoredproc 方法出错
我正在使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的存储过程实际上不返回结果集(可能它返回一个输出参数,或者根本不返回任何内容),您将收到此错误。
只需删除对 .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.