Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error with addstoredproc method in cfscript

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();
like image 554
RHPT Avatar asked Aug 20 '26 04:08

RHPT


1 Answers

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.

like image 110
Shawn Holmes Avatar answered Aug 23 '26 21:08

Shawn Holmes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!