I have a query and looping the results of a query. I want to display the names 
from the cfdocexamples when the user enters the first letters of their Names. I 
am using Ajax here...and the query is 
<cffunction name="getName" access="remote" output="false"  returntype="query">
        <cffunction name="getEMPID" access="remote" output="false"  
returntype="array">

      <cfargument name="Name_First">
    
        <cfquery name="get_bnk_name" datasource="cfdocexamples">
            SELECT  FirstName
            FROM Employees
            where UCase(FirstName) LIKE Ucase('%#ARGUMENTS.Name_First#%')
           
        </cfquery>
       
        <!--- Build result array --->
        <cfset result=ArrayNew(1)>
    <cfloop query="get_bnk_name">
        <cfset ArrayAppend(result, FirstName)>
    </cfloop>
     <cfreturn result>
    </cffunction>
And now I wrote a stored procedure for this query and when I execute the same 
code I am getting an error at the cfloop.... and the code is ..

<cffunction name="getEMPID" access="remote" output="false"  returntype="array"> 
<cfargument name="Name_First">    
<cfstoredproc procedure="GetNameList" datasource="cfdocexamples"> 
                                                <cfprocparam 
cfsqltype="CF_SQL_VARCHAR" value='%#ARGUMENTS.Name_First#%' type="in">
                                                <cfprocresult name="FirstName" >
                                        </cfstoredproc>   
                        </cffunction>
                                 <!--- Build result array --->
                                        <cfset result=ArrayNew(1)>
                                        <cfloop query="GetNameList">
                                <cfset ArrayAppend(result,FirstName)>
                                        </cfloop>
                                <cfreturn result>
What do I need to use at the place of query in cfloop ...... I am using stored 
Procedure name ...? Is it not right.....????

Thanks,
Priya 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320917
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to