Skip to main content
Participant
January 15, 2009
Question

CFSTOREDPROC Issues

  • January 15, 2009
  • 4 replies
  • 1407 views
I am executing the following code, and per the manual this should work. It's running on a MS SQL db which I can perform regular queries on without issue. It only bombs out when I try a stored procedure (I haven't worked with them in the past through CF).

When executed I get the error:

Variable TEST is undefined.

The stored procedure works fine through SQL Data Manager. Its purpose is to be given a username, and return their password.

Any ideas on how I can fix this issue? Thanks.
This topic has been closed for replies.

4 replies

FYAD_AFAuthor
Participant
January 15, 2009
Yep, just started playing with that to try to fix this. Thanks for the help!
FYAD_AFAuthor
Participant
January 15, 2009
Thanks for helping. When I make the change to type="out" I get this. I'm pretty sure this is do to the person who wrote the SP not anticipating us going this route.

[Macromedia][SQLServer JDBC Driver][SQLServer]The formal parameter "@user" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output.
Inspiring
January 15, 2009
FYAD_AF,

Can you post the stored procedure, or an obfuscated version, so we can see the parameters it expects and the results it returns?
FYAD_AFAuthor
Participant
January 15, 2009
Sure thing.
FYAD_AFAuthor
Participant
January 15, 2009
The SP does not return a record set, it returns a single string. Is there a way to reference just that string instead of an entire record set? Thanks!
Inspiring
January 15, 2009
quote:

The SP does not return a record set, it returns a single string.

If you are using an output parameter then add a cfprocparam tag with type="out".

Inspiring
January 15, 2009
This error is probably occuring because your stored procedure does not return a recordset.

The variable test should contain a query recordset, assuming that your stored procedure returns a recordset. To reference its contents you will need to refer to test.columnName to the get the contents for a given column just as if the variable test was the name of a cfquery recordset.