Pulling Data from StoredProcs using CFC's
I have a question about selecting data from a stored proc.
I have used CFQuery to select data from storedProcs out of databases i.e.:
------------------------------------------------------------------------------------------------------------
<cffomponent displayname="data" hint="The file name is data.cfc">
<cffunction name="myFunctionName" hint="This is for an exaple on the discussion boards" returnType="query">
<cfargument name="start" type="date" required="true">
<cfargument name="end" type="date" required="true">
<cfquery name="myDataSource" datasource="#dsn#" dbtype="ODBC">
exec sp_MyStoredProc @start = '#ARGUMENTS.start#', @8978565="#ARGUMENTS.end#;"
</cfquery>
<cfreturn myDataSource>
</cffunction>
</cfcomponent>
The return on the presentation Page is this:
<cfinvoke component="data" method="myFunctionName" returnvariable="Var">
<cfinvokeargument name="start" value="#form.start#">
<cfinvokeargument name="end" value="#form.end#">
</cfinvoke>
<cfdump var="#Var#>
------------------------------------------------------------------------------------------------------------
The question I need answered is how do I return a select stored proc with the above logic.
This is what I have so far:
------------------------------------------------------------------------------------------------------------
<cffomponent displayname="data" hint="The file name is data.cfc">
<cffunction name="myFunctionName" hint="This is for an exaple on the discussion boards" returnType="query">
<cfargument name="start" type="date" required="true">
<cfargument name="end" type="date" required="true">
<cfstoredproc procedure="myStoredProc" datasource="#dsn#">
<cfstoredprocparam cfsqltype="CF_SQL_DATE" value="#ARGUMENTS.start#">
<cfstoredprocparam cfsqltype="CF_SQL_DATE" value="#ARGUMENTS.end#">
<cfprocresult name="someData"
</cfstoredproc>
<cfreturn myDataSource>
</cffunction>
</cfcomponent>
------------------------------------------------------------------------------------------------------------
My questios are:
How do I query the Stored Procedure from the database and get results from it using this CFC function and do I use cfinvoke to pull the data for the display page.
Thanks in advance.
