well you'd be returning a recordset (albeit with one record)...so you
can't simply output it.

try

<cfdump var="#getSubpages(3)#" />

On 1/18/07, Chad Gray <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am new to cfc's, functions etc...
>
> I have a query that will be used many times and would like to keep the query 
> code in a single file then just call that function when I need it.
>
> So say I do this:
> <CFFUNCTION NAME="getSubPages" RETURNTYPE="query">
>    <CFARGUMENT NAME="pageID" TYPE="string" REQUIRED="yes">
>
>         <cfquery datasource="#application.dsn#" name="SubPages">
>         SELECT *
>         FROM PageContent
>         WHERE ParentID = #arguments.pageID#
>         </cfquery>
>
>    <CFRETURN SubPages>
> </CFFUNCTION>
>
> How do I call this function then loop over the returned results?
>
> I cant find an example of doing this and everything I have tried has not 
> worked.
>
> I should just be able to do this right?  #getSubpages("3")# but I get errors 
> about complex data type.
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266923
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to