Again - check out the UDF I sent in earlier. As an FYI, you do NOT need
to use evaluate to get dynamic values from a query. You can change
Evaluate(QueryItem) to ItemSearchResultsSubSet[QueryItem][CurrentRow].

Also - your CFC method should use the var statement to declare each and
every variable defined in the method.

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Hire

Email    : [EMAIL PROTECTED]
WWW      : www.camdenfamily.com/morpheus
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Ilyinsky, Igor [mailto:igor.ilyinsky@;csfb.com] 
> Sent: Thursday, November 07, 2002 9:29 AM
> To: CF-Talk
> Subject: RE: CFC - Returning a Query Subset
> 
> 
> OK, so I guess I'm the first one to need this. Here's a 
> sample of the resulting code, if anyone needs this sorta 
> thing in the future:
> 
> 
> <CFCOMPONENT>
>       <CFFUNCTION NAME="ItemSearch" RETURNTYPE="query" 
> ACCESS="remote">
>               <CFARGUMENT NAME="StartRow" DEFAULT="1"  TYPE="numeric">
>               <CFARGUMENT NAME="RowCount" DEFAULT="10" TYPE="numeric">
> 
>               <CFQUERY NAME="ItemSearchResults" DATASOURCE="myDSN">
>               SELECT * FROM Items
>               </CFQUERY>
> 
>               <CFSET ItemSearchResultsSubSet = 
> QueryNew(ItemSearchResults.ColumnList)>
>               <CFOUTPUT query="ItemSearchResults" 
> startrow="#StartRow#" maxrows="#MaxRows#">
>               <CFSET TEMPVAR = QueryAddRow(ItemSearchResultsSubSet,1)>
>               <CFLOOP list="#ItemSearchResults.ColumnList#" 
> index="QueryItem">
>                               <CFSET TEMPVAR = 
> QuerySetCell(ItemSearchResultsSubSet, QueryItem, Evaluate(QueryItem))>
>               </CFLOOP>
>               </CFOUTPUT>
> 
>               <CFRETURN ItemSearchResults>
>       </CFFUNCTION>
> </CFCOMPONENT>
>       
>         
> IGOR  ILYINSKY
> CREDIT|FIRST
> SUISSE|BOSTON
> GLOBAL WEB SERVICES
>       (212) 892-9314
>               4-9314
> 
> 
> 
> 
> -----Original Message-----
> From: Ilyinsky, Igor [mailto:igor.ilyinsky@;csfb.com]
> Sent: Wednesday, November 06, 2002 5:27 PM
> To: CF-Talk
> Subject: RE: CFC - Returning a Query Subset
> 
> 
> Thanks Ade,
> 
> But, the entire query is a full search, with tons of clauses. 
> So I can't sort by ID, and I can't just pick up the TOP 
> #rowCount# results. I need a SQL compliant query (as the DB 
> may change, currently Access) and I need to return only the 
> necessary subset to the cfc caller.
> 
> I'm trying to avoid copying/parsing into a new Query Object, 
> as this is a huge pain in the a**; unless someone has a cool 
> utility for this.
> 
> IGOR  ILYINSKY
> CREDIT|FIRST
> SUISSE|BOSTON
> GLOBAL WEB SERVICES
> 
> 
> -----Original Message-----
> From: Adrian Lynch [mailto:adrian.l@;thoughtbubble.net]
> Sent: Wednesday, November 06, 2002 1:57 PM
> To: CF-Talk
> Subject: RE: CFC - Returning a Query Subset
> 
> 
> I guess if you have an ID column you could try...
> 
> <CFCOMPONENT>
>       <CFFUNCTION NAME="ItemSearch" RETURNTYPE="query" 
> ACCESS="remote">
>               <CFARGUMENT NAME="StartRow" DEFAULT="1"  TYPE="numeric">
>               <CFARGUMENT NAME="RowCount" DEFAULT="10" TYPE="numeric">
> 
>               <CFQUERY NAME="ItemSearchResults" DATASOURCE="myDSN">
>                       SELECT * FROM Items
>                       WHERE id >= #ARGUMENTS.startRow# AND id <=
> #ARGUMENTS.rowCount#
>               </CFQUERY>
>       
>               <CFRETURN ItemSearchResults>
>       </CFFUNCTION>
> </CFCOMPONENT>
> 
> or try
> 
> <CFQUERY NAME="ItemSearchResults" DATASOURCE="myDSN">
>       SELECT TOP #ARGUMENTS.rowCount# * FROM Items
>       WHERE id >= ARGUMENTS.startRow
> </CFQUERY>
> 
> Ade
> 
> -----Original Message-----
> From: Ilyinsky, Igor [mailto:igor.ilyinsky@;csfb.com]
> Sent: 06 November 2002 18:17
> To: CF-Talk
> Subject: CFC - Returning a Query Subset
> 
> 
> Kids,
> 
>       I'm sure someone has done this recently, so save me 
> some time here.
> I have a CFC that runs a search query, and returns a query 
> object; however,
> to save bandwidth, I only want to return a subset of the 
> query (specified by
> a StartRow and RowCount).
> 
> It basically looks something like this:
> 
> <CFCOMPONENT>
>       <CFFUNCTION NAME="ItemSearch" RETURNTYPE="query" 
> ACCESS="remote">
>               <CFARGUMENT NAME="StartRow" DEFAULT="1"  TYPE="numeric">
>               <CFARGUMENT NAME="RowCount" DEFAULT="10" TYPE="numeric">
> 
>               <CFQUERY NAME="ItemSearchResults" DATASOURCE="myDSN">
>               SELECT * FROM Items
>               </CFQUERY>
>       
>               <CFRETURN ItemSearchResults>
>       </CFFUNCTION>
> </CFCOMPONENT>
> 
> How do I get it to return only rows 1 through 10 (or 24 thru 
> 377 for that
> matter).
> This is not a copy and paste of my code, but just a type-out, 
> so excuse any
> type-o's.
> 
> TIA
> 
> IGOR  ILYINSKY 
> CREDIT|FIRST 
> SUISSE|BOSTON 
> GLOBAL WEB SERVICES 
> 
> 
> 
> 
> 
> 
> This message is for the named person's use only. It may 
> contain sensitive
> and private proprietary or legally privileged information. No
> confidentiality or privilege is waived or lost by any 
> mistransmission. If
> you are not the intended recipient, please immediately delete 
> it and all
> copies of it from your system, destroy any hard copies of it 
> and notify the
> sender. You must not, directly or indirectly, use, disclose, 
> distribute,
> print, or copy any part of this message if you are not the intended
> recipient. CREDIT SUISSE GROUP and each legal entity in the 
> CREDIT SUISSE
> FIRST BOSTON or CREDIT SUISSE ASSET MANAGEMENT business units 
> of CREDIT
> SUISSE FIRST BOSTON reserve the right to monitor all e-mail 
> communications
> through its networks. Any views expressed in this message are 
> those of the
> individual sender, except where the message states otherwise 
> and the sender
> is authorized to state them to be the views of any such entity.
> Unless otherwise stated, any pricing information given in 
> this message is
> indicative  only, is subject to change and does not 
> constitute an offer to
> deal at any price quoted. Any reference to the terms of executed
> transactions should be treated as  preliminary only and subject to our
> formal written confirmation.
> 
> 
> 
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to