tags:

views:

234

answers:

1

I am getting the error "Procedure sp_Get-- has no parameters and arguments were supplied". I am calling a simple stored-proc from a CF component.

The Stored proc is as follows

GO ALTER PROCEDURE [dbo].[sp_GetTest]
  @TestId INT AS BEGIN
  SET NOCOUNT ON;

  SELECT T.TestId
        ,T.TestDetail
        ,T.isPassedTest     
    FROM Test T  
   WHERE T.TestId = @TestId
ORDER BY T.TestDetail

END

I am calling it in CF8 component/method in the following manner:-

<cffunction name="GetTest" returntype="query" access="public" output="false">
  <cfargument name="Test" type="......Test.Test" required="true">
  <cfstoredproc procedure="sp_GetTest" datasource="#variables.datasource#">
    <cfprocparam cfsqltype="CF_SQL_INTEGER" value="#arguments.Test.GetTestId()#">     
    <cfprocresult name="theTest" resultset="1">
  </cfstoredproc>

  <cfscript>return theTest;</cfscript>
</cffunction>

Kindly help me in debugging the error! Thanks Vas

+5  A: 

Is it possible you have two versions of the stored procedure created, one with dbo as owner and with this parameter defined, and the other with the user via which you connect to the database as owner and with this parameter not defined? Can you try using "dbo.sp_GetTest" as the procedure name in CF?

David M
bulls eye ...it was an typo error from my side in the CFC component.I corected it
vas