CFC Error on QoQ

Error:
Error casting an object of type to an incompatible type. This usually indicates a programming error in Java, although it could also mean you have tried to use a foreign object in a different way than it was designed.
The error occurred in C:\Inetpub\wwwroot\RMS\Untitled-3.cfm: line 15
13 :                     <cfloop from="1" to ="#listlen(application.Sql_SC)#" index="i">
14 :                     union
15 :                          <cfquery name="GetZone#i#" datasource="#i#">
16 :                          SELECT ccflocationID, Location_Name
17 :                          FROM ccflocation
<cfcomponent hint="This cfc goes to Scorecard environment and grabs some stuff">
<cffunction name="Zone" access="public" returntype="Query">
<cfset myLoc = QueryNew("ccflocationID,Location_Name", "Integer,VarChar")>
<cfargument name="DSN" required="true" type="string">
<cfquery dbtype="query" name="GetZone">
select ccflocationID, Location_Name from myLoc
<cfloop from="1" to ="#listlen(arguments.DSN)#" index="i">
  union
  <cfquery name="GetZone#i#" datasource="#i#">
   SELECT ccflocationID, Location_Name
   FROM ccflocation
  </cfquery>
</cfloop>
</cfquery>
<cfreturn GetZone>
</cffunction>
</cfcomponent>

You can NOT mix QoQ and DB queries together...
this is QoQ
<cfquery dbtype="query" name="GetZone">
this is DB query
<cfquery name="GetZone#i#" datasource="#i#">
You will need to run your DB queries first (outside QoQ)
and then run the loop again to UNION all results...
<cfloop from="1" to ="#listlen(arguments.DSN)#" index="i">
   <cfquery name="GetZone#i#" datasource="#i#">
    SELECT ccflocationID, Location_Name
    FROM ccflocation
   </cfquery>
</cfloop>
<cfquery dbtype="query" name="GetZone">
select ccflocationID, Location_Name from myLoc
<cfloop from="1" to ="#listlen(arguments.DSN)#" index="i">
  union
select ccflocationID, Location_Name from GetZone#i#
</cfloop>
</cfquery>

Similar Messages

  • MM_XSLTransform.cfc error: cfcatch.Proc

    I've been using the MM_XSLTransform.cfc for a couple years to
    do XSL transformation on a site, and it's worked quite well. Only
    just last night, I started receiving an error regarding
    cfctach.Proc:
    Element PROC is undefined in CFCATCH. <br>The error
    occurred on line 135.
    As well as:
    Element PROC is undefined in CFCATCH. <br>The error
    occurred on line 133.
    The version of the CFC that I'm using is 0.6.2, which I
    believe is the version that comes with Dreamweaver 8. Not sure if
    there's a new version for Dreamweaver CS3 or Dreamweaver CS4, for
    that matter.
    In any case, the lines in question are as follows:
    <cftry>
    <cfset XMLParse(myFile)>
    <cfcatch type="any">
    <cfif type EQ "xml">
    <cfset setError(getErrorFromCode('MM_INVALID_XML_ERROR',
    errSrc) & cfcatch.Proc & ' ' & mySrc & '<br>'
    & cfcatch.Message & '<br>' &
    HTMLEditFormat(cfcatch.Detail) & '<br>' &
    HTMLCodeFormat(myFile))>
    <cfelse>
    <cfset setError(getErrorFromCode('MM_INVALID_XSL_ERROR',
    errSrc) & cfcatch.Proc & ' ' & mySrc & '<br>'
    & cfcatch.Message & '<br>' &
    HTMLEditFormat(cfcatch.Detail) & '<br>' &
    HTMLCodeFormat(myFile))>
    </cfif>
    </cfcatch>
    </cftry>
    This error could also potentially pop up in this section:
    <cftry>
    <cfset output = XmlTransform(Arguments['xml'],
    Arguments['xsl'])>
    <cfcatch type="any">
    <cfset
    setError(getErrorFromCode('MM_TRANSFORMATION_ERROR') &
    cfcatch.Proc & & '<br>' & cfcatch.Message)>
    </cfcatch>
    </cftry>
    In looking at the documentation for cfcatch, Proc (as in
    cfcatch.Proc) does not appear to be a valid attribute for cfcatch,
    and there isn't anywhere else within the cfc where Proc gets tacked
    on to the cfcatch.
    For now, to prevent the error from occurring, I've commented
    out all instances of cfcatch.Proc.
    Not sure why this popped up now. It may mean there's an error
    in one of my XML files, which I will need to investigate.
    If anyone has any insight to share on the perils of
    cfcatch.Proc, it would be appreciated.
    Thanks,
    Marc

    I am passing RequestTimeOut="120" in the url. The 120 seconds
    is the value that has been determined to be the maximum that we
    want the app to run before timing out. The issue I have is that the
    ColdFusion Blue Error page is not acceptable error handling and I
    have not been able to capture the timeout. That is my request, how
    to capture the timeout and follow acceptable error handling in this
    timeout situation.

  • Nothing but CFC errors..

    Ok.. so here's the layout;
    My personal computer:
              Flex Builder 3
              MAC Leopard
              Dreamweaver CS4
    Server:
              ColdFusion MX 6.1 (fully updated)
              IIS
    Trying to build a simple CFC to retrieve a record of data from a datasource from within Flex.  When I visit the WSDL URL (http://blah.blah.com/mycfc/db_getbrat.cfc?wsdl), it shows the following:
    <wsdl:definitions targetNamespace="http://mycfc">
    <wsdl:portType name="db_getBrat">
      </wsdl:portType>

    <wsdl:binding name="db_getBrat.cfcSoapBinding" type="impl:db_getBrat">
    <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    </wsdl:binding>

    <wsdl:service name="db_getBratService">

    <wsdl:port name="db_getBrat.cfc" binding="impl:db_getBrat.cfcSoapBinding">
    <wsdlsoap:address location="http://blah.blah.com/mycfc/db_getBrat.cfc"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    So it appears that the CFC is working and loaded.  I have even tested the code within the CFC (the SQL query and output) using a basic .CFM file, and it works perfectly.  So I know the DSN and query are working.
    However, when I use the following code:
         <mx:WebService id="srv" wsdl="http://blah.blah.com/mycfc/db_getBrat.cfc?wdsl" useProxy="false" showBusyCursor="true" />
        <mx:DataGrid dataProvider="{srv.retrieveBrat.lastResult}" width="726" height="194" x="25" y="10">
            <mx:columns>
                <mx:DataGridColumn dataField="contactid" headerText="Contact ID"/>
                <mx:DataGridColumn dataField="firstname" headerText="First Name"/>
                <mx:DataGridColumn dataField="lastname" headerText="Last Name"/>
            </mx:columns>
        </mx:DataGrid>
        <mx:Button label="Get Data" click="srv.retrieveBrat()" x="25" y="212"/>
    I get the following error in a popup after the application loads:
    RPC Fault faultString="Error #1085: The element type "br" must be terminated by the matching end-tag "</br>"." faultCode="Client.CouldNotDecode" faultDetail="Unable to load WSDL. If currently online, please verify the URI and/or format of the WSDL (http://blah.blah.com/mycfc/db_getBrat.cfc?wdsl)"]
        at mx.rpc.wsdl::WSDLLoader/faultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\ rpc\wsdl\WSDLLoader.as:98]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[C:\autobuild\3.2.0\framewor ks\projects\rpc\src\mx\rpc\AbstractInvoker.as:170]
        at mx.rpc.http::HTTPService/http://www.adobe.com/2006/flex/mx/internal::processResult()[C:\autobuild\3.2.0\frameworks\ projects\rpc\src\mx\rpc\http\HTTPService.as:925]
        at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[C:\autobuild\3.2.0\frameworks\ projects\rpc\src\mx\rpc\AbstractInvoker.as:188]
        at mx.rpc::Responder/result()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responde r.as:43]
        at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\ AsyncRequest.as:74]
        at DirectHTTPMessageResponder/completeHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\s rc\mx\messaging\channels\DirectHTTPChannel.as:403]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/onComplete()
    And when I run a .CFM file to <cfinvoke..> the CFC, I get the following error:
    Name: http://blah.blah.com/mycfc/db_getBrat.cfc?wdsl.
    WSDL: http://blah.blah.com/mycfc/db_getBrat.cfc?wdsl. org.xml.sax.SAXException:
    Fatal Error: URI=null Line=40: Expected "" to terminate element starting on line 16.
    Only problem is.. there IS no line 16 in the CFC.. but that's the right one.  Only one in there.  And that very same URL in my browser pulls up
    the WSDL info above.
    Anyone have a clue as to why this is happening?  I'm about to throw the computers out the window.  (well.. not really.. too expensive)
    Thanks to all, in advance, for any help..

    couple things, how come you didnt use and mx:operation tag between the mx:webservice open and close tags?  im not sure if thats even the issue but to me it makes it easier because you specify the function inside the cfc you're trying to call by doing this.
    also, most of the time when you get the wsdl error you wrote of, its because of some mal-formed xml.  if your result has any html tags in its output, theres a good chance youll get a parsing error because xml is wicked picky.  youd wanna do a coldfusion string replace function to look for < or > signs.
    if you want, post your flex and cfc code, i just finished doing a few projects doing the exact same stuff so i got it fresh in my head!

  • Cfc error when using Flex and RemoteObject (cross post)

    I have Flex 3.0.214193 and CF 8,0,0,176276 and Oracle
    10.2.0.3.
    I've been search for several days for an answer to this one.
    There is very little out there about this type of error, but then
    there is very little about any problems with Flex and ColdFusion.
    In Flex, I have two comment fields. the .cfc has two update
    functions that update the comments, because they are in two
    different tables. The first update works like a champ. The second
    one consistantly shows this error in the CF application log: The
    NEWENGREMARK parameter to the updateEng function is required but
    was not passed in. I've used the Alert.Show to verify that Flex
    does have a value in that variable when it calls the .cfc. I've
    even tried passing the first variable that worked in the first
    update, and even a litteral value. Everything yields the same
    cryptic error message. I must be looking at the wrong thing.
    The only things I've found on the web about this, say the
    variables should have a scope (is that a scope in Flex or in the
    .cfc) and the column names should be in upper case (because it's
    Oracle).
    Here's the .cfc code (is that where the error is, or is it in
    Flex?). The UpdateDescription function works, but the UpdateEng
    doesn't.
    Thanks for any help, or spelling errors you can point out.
    Scott

    Ian,
    I also heard about the case thing. So I tried everything in
    upper case and lower case - same thing. In my experimenting, I
    tried adding the newENGRemark parameter to the descriptionUpdate
    function call, I didn't do anything with it is the .cfc just
    declared it as required. In that case the parameter exists and
    everything is fine. But in the call to the UpdateEng, it doesn't
    exist.
    I changed the .cfc so that the newENGRemark was not required
    or had a default. In both cases the .cfc just skipped to the next
    parameter and said it didn't exist. But I was passing a litteral,
    it wasn't even a variable.
    I created a .cfm page that did a cfinvoke on the .cfc, and
    passed it two litterals. That worked fine. So that makes it look
    like some sort of syntax error in the Flex. So I deleted the call
    to the UpdateENG, copied the UpdateDescription call (because it
    works), changed just the minimum to make it work, but it didn't
    work.
    I think I am going to restructure the database so that I can
    do what I need to with just one update function, that seems to
    work.
    It still doesn't make any sense.
    Scott (Flex code is attached)

  • CFC Error Message

    Am using Dreamweaver 8 and CF MX 7. All the CFCs I've created
    were created manually, not using Dreamweaver. I then copy the CFC,
    and modify it as needed for other applications in different
    folders. But all apps are part of the same SITE.
    However, when I click IN and OUT of a template that contains
    a CFINVOKE to a CFC, I get a quick pop-up message that says:
    "The required component could not be found at the specified
    location." I just click OK, the message goes away. The programs and
    templates work fine. I probably have a dozen report forms that
    INVOKE a CFC (all in the same site) but I did not create any of the
    CFCs in Dreamweaver, just coded them manually.
    Is there some way to get rid of this message? Or is this
    normal when you DON'T create the CFC with Dreamweaver? When I click
    on APPLICATIONS/COMPONENTS, it tells me "THERE ARE NO CFCs DEFINED
    IN THE CURRENT SITE." But they are there, and I'm using them.
    I'd like to (but not totally necessary) inspect/modify the
    CFCs in Dreamweaver. But it tells me the first thing I need to do
    is "CREATE A SITE FOR THIS FILE", followed by the other 3
    instructions related to DOCUMENT TYPE, TESTING SERVER, and RDS
    LOGIN.
    I've already created the site in Dreamweaver. So I guess the
    question is: "HOW DO YOU -ADD- A CFC, SO YOU CAN WORK WITH IT IN
    DREAMWEAVER, WHEN YOU'VE ALREADY CREATED THE SITE? Every time I
    experiment, Dreamweaver seems to always want me to create a SITE.
    But my application has been using the same "site" for 5 years, it's
    already created. So not sure what is wrong.
    Would appreciate any advice on either how to get rid of the
    error message, or how to ADD a CFC created manually to Dreamweaver
    when you've already created the site. Any advice would be greatly
    appreciated. Thank you.
    Gary

    Thanks for the response. Glad you found a way to get your
    CFCs to show up in Dreamweaver. However, I need to keep my site in
    a virtual folder, so that I know the web server is working
    correctly. Otherwise, I would be using "hard coded" URLs to
    run/test my CFM files. It's important for my "development"
    environment to mimic the production environment (production server
    also has site in virtual folder) to be certain that programs that
    run fine on "development", run fine on "production."
    So I guess the million dollar question is: Is there some way
    to get Dreamweaver to recognize CFCs located in sites where the
    site root is in a virtual folder?
    I may have better luck getting the answer on the Dreamweaver
    forum. But maybe someone here might now. Many thanks again for
    getting back. Good luck with your CF development.
    Gary

  • GetHumansThisPlanet.cfc error

    I don't know if this is a bind problem or not - I'm not getting an error, I'm getting empty dropdowns on the form page. (The
    cfc and cfm both reside in the same folder.) I've googled this planet and just can't find why the form selects aren't
    dynamically loading from the cfc - What am I missing here? (This is based on Forte's cfc dynamic selects.)
    Thanks for anyone's advice...
    - e
    ********************* getHumansThisPlanet.cfc
    <cfcomponent output="false">
        <cfset THIS.dsn="#application.dsn#">
        <!--- Get array of Places --->
    <cffunction name="getPlanets" access="remote" returnType="array">
            <!--- Define variables --->
            <cfset var data="">
            <cfset var result=ArrayNew(2)>
            <cfset var i=0>
        <!--- Get Places --->       
    <CFQUERY NAME="PlanetData" DATASOURCE="#THIS.dsn#">
    SELECT DISTINCT PlanetNumber, PlanetName
    FROM PlanetTable
         WHERE AdminLevel = 'three' AND PlanetYear = '2010-2011' AND ParticipationLevel = 'jumpingUpandDown'
         ORDER BY PlanetName ASC;
    </cfquery>
        <!--- Convert results to array --->
            <cfloop index="i" from="1" to="#PlanetData.RecordCount#">
                <cfset result[i][1]=PlanetData.PlanetNumber[i]>
                <cfset result[i][2]=PlanetData.PlanetName[i]>
            </cfloop>
        <!--- And return it --->
            <cfreturn result>
        </cffunction>
        <!--- Get Humans by Planet --->
        <cffunction name="getHumans" access="remote" returnType="array">
            <cfargument name="PlanetNumber" type="numeric" required="true">
        <!--- Define variables --->
            <cfset var data="">
            <cfset var result=ArrayNew(2)>
            <cfset var i=0>
        <!--- Get data --->
            <cfquery name="HumanData" datasource="#THIS.dsn#">
            SELECT HumanID, PlanetNumber, Lname + ', ' + Fname AS FullName
            FROM HumanTable
            WHERE PlanetNumber = #ARGUMENTS.PlanetNumber#
            ORDER BY Lname ASC;
            </cfquery>
        <!--- Convert results to array --->
            <cfloop index="i" from="1" to="#HumanData.RecordCount#">
                <cfset result[i][1]=HumanData.HumanID[i]>
                <cfset result[i][2]=HumanData.Fullname[i]>
            </cfloop>
        <!--- And return it --->
            <cfreturn result>
    </cffunction>
    </cfcomponent>
    ********************* CFM page
    <cfform action="EmailThisHuman.cfm" method="POST">
        <input type="hidden" name="SendTo" value="THIS Human THIS Planet">
      <tr>
        <td height="40" align="left" valign="middle" bgcolor="#FFFFFF"> </td>
        <td height="40" align="left" valign="middle" bgcolor="#FFFFFF">
        <span class="eleven_pt_bold_blue_ariel">Email THIS Human THIS Planet</span>
        <img src="transparent.gif" width="15" height="1" alt="spacer" />
                     <cfselect name="getPlanets"
                     message="------ Select Planet ------"
                     bind="cfc:getHumansThisPlanet.getPlanets()"
                     size="1"
                     onChange="document.getElementById('getHumans').style.visibility='visible'"
      bindonload="true" />
        <img src="transparent.gif" width="15" height="1" alt="spacer" />
                    <cfselect name="getHumans"
                    bind="cfc:getHumansThisPlanet.getHumans({FullName})"
                    message="----- Select Human -----"
                    style="visibility:hidden"
                    id="getHumans"
                    onChange="document.getElementById('HumanSubmitButton').style.visibility='visible'" />
        <img src="transparent.gif" width="15" height="1" alt="spacer" />
        <input type="submit" name="HumanSubmitButton" id="HumanSubmitButton" value="Submit" style="visibility:hidden" />
        </td>
        <td height="40" align="left" valign="middle" bgcolor="#FFFFFF"> </td>
      </tr>
    </cfform>

    Thanks to all of you looking at this...
    The queries do run. When I did the "test" from BKBK (see above - planetTest.cfm) this test page does pull the fields from the database.
    I just tried BKBK's new code and I'm still getting the same result - a blank dropdown.
    I do have de-bugging on and it's not throwing an error. The cfm page displays correctly - but the first dropdown is still empty.
    For a fresh outlook... The following is the current code as per BKBK's latest suggestions... which is still not populating the select.
    (The following is the original code -- "teacher" replaces "human" and "school" replaces "planet". I changed the field names in the original post in just trying to gain an understanding on how all this works instead of someone 'fixing my code' - I want to understand the whole process since this is my first try at building a cfc page. It was starting to get confusing to me to reword everything to run on the server.)
    Thanks again, y'all...
    - e
    **************cfc
    <cfcomponent output="false">
        <cfset THIS.dsn="#application.dsn#">
        <!--- Get array of Schools --->
        <cffunction name="getSchools" access="remote" returnType="array">
            <!--- Define variables --->
            <cfset var data="">
            <cfset var result=ArrayNew(2)>
            <cfset var i=0>
            <!--- Get Schools --->       
            <CFQUERY NAME="SchoolData" DATASOURCE="#THIS.dsn#">
    SELECT DISTINCT
         schoolNumber, SchoolName
    FROM
      teacher_logon
        WHERE AdmnLevel = 'tchr' AND SchoolYear = '2010-2011' AND ParticipationLevel = 'active'
        ORDER BY SchoolName ASC;
      </cfquery>
            <!--- Convert results to array --->
        <cfset result[1][1]="">
    <cfset result[1][2]="------ Select School ------">
    <cfloop query="SchoolData">
        <cfset result[currentrow+1][1]=schoolNumber>
        <cfset result[currentrow+1][2]=SchoolName>
    </cfloop>
            <!--- And return it --->
            <cfreturn result>
        </cffunction>
        <!--- Get Teachers by School --->
        <cffunction name="getTeachers" access="remote" returnType="array">
            <cfargument name="schoolNumber" type="numeric" required="true">
            <!--- Define variables --->
            <cfset var data="">
            <cfset var result=ArrayNew(2)>
            <cfset var i=0>
            <!--- Get data --->
            <cfquery name="TeacherData" datasource="#THIS.dsn#">
            SELECT adminID, schoolNumber, Lname + ', ' + Fname AS FullName
            FROM teacher_logon
            WHERE schoolNumber = #ARGUMENTS.schoolNumber#
            ORDER BY Lname ASC;
            </cfquery>
            <!--- Convert results to array --->
        <cfset result[1][1]="">
    <cfset result[1][2]="------ Select Teacher ------">
    <cfloop query="TeacherData">
        <cfset result[currentrow][1]=adminID>
        <cfset result[currentrow][2]=Fullname>
    </cfloop>
            <!--- And return it --->
            <cfreturn result>
        </cffunction>
    </cfcomponent>
    *****************cfm
    <cfform action="EmailTeacherThisSchool.cfm" method="POST">
        <input type="hidden" name="SendTo" value="THIS Teacher THIS School">
      <tr>
        <td height="40" align="left" valign="middle" bgcolor="#FFFFFF"> </td>
        <td height="40" align="left" valign="middle" bgcolor="#FFFFFF">
        <span class="eleven_pt_bold_blue_ariel">Email THIS  Teacher THIS School</span>
        <img src="transparent.gif" width="15" height="1" alt="spacer" />
        <cfselect name="School"
                    bind="cfc:getTeachersThisSchool.getSchools()"
                    size="1"
                    onChange="document.getElementById('Teacher').style.visibility='visible'"               
                    bindonload="true" />
        <img src="transparent.gif" width="15" height="1" alt="spacer" />
                    <cfselect name="Teacher"
                    bind="cfc:getTeachersThisSchool({School})"
                    style="visibility:hidden"
                    id="Teacher"
                    onChange="document.getElementById('TeacherSubmitButton').style.visibility='visible'" />
        <img src="transparent.gif" width="15" height="1" alt="spacer" />
        <input type="submit" name="TeacherSubmitButton" id="TeacherSubmitButton" value="Submit" style="visibility:hidden" />
        </td>
        <td height="40" align="left" valign="middle" bgcolor="#FFFFFF"> </td>
      </tr>
      </cfform>

  • Cfc error

    I have a very simple page that contains a one cell one column
    table with no graphics (I am just developing the code for a project
    at this point. I have a cfinvoke statement passing a
    cfinvokeargument. Below is my code:
    <table width="500" border="0" align="center">
    <tr>
    <td>
    <cfinvoke component="cfcs.cmsContentForms"
    method="displayContent" returnvariable="displayContent">
    <cfinvokeargument name="contentID" value="1"/>
    </cfinvoke>
    </td>
    </tr>
    </table>
    It was running fine and then just today it began to kick up
    this error:
    Unable to complete CFML to Java translation.
    Error information unsupported statement: class
    coldfusion.compiler.ASTfunctionDefinition
    The error occurred in D:\www\CMS\contentDisplay.cfm: line 5
    3 : <td>
    4 : <cfinvoke component="cfcs.cmsContentForms"
    method="displayContent" returnvariable="displayContent">
    5 : <cfinvokeargument name="contentID" value="1"/>
    6 : </cfinvoke>
    7 : </td>
    Any one have any ideas at all what the heck this means. I
    can't find anything online about it and as far as I can tell my
    code is good.
    Thanks,
    Jason

    Thanks,
    Tried both of those and got the same error:
    Error information unsupported statement: class
    coldfusion.compiler.ASTfunctionDefinition
    The error occurred in D:\www\CMS\contentDisplay.cfm: line 4
    2 : <tr>
    3 : <td>
    4 : <cfset componentObj =
    createObject("component","cfcs.cmsContentForms")>
    5 : <cfset displayContent =
    componentObj.displayContent(1)>
    6 : </td>
    I had it working at one point so I may just have to start
    again at square one and re-develop it until I break it again to
    know what I did (or until it works and then wonder what the heck I
    did the first time).
    Has any one else ever run into this error? It is very
    unhelpful as far as identifying the source of the problem!

  • CFC Error -pass parameters

    Can anyone point out a solution this error? Thank you in
    advance...the BossEID is not blank...
    The parameter CCFBOSSEID to function update is required but
    was not passed in.
    The error occurred in
    C:\Inetpub\wwwroot\Scorecard33\admin\ccf\bridge\act_csv.import.cfm:
    line 82
    Called from
    C:\Inetpub\wwwroot\Scorecard33\parsed\bridge.csv.cfm: line 30
    Called from
    C:\Inetpub\wwwroot\Scorecard33\fusebox5\Application.cfc: line 228
    Called from
    C:\Inetpub\wwwroot\Scorecard33\fusebox5\Application.cfc: line 218
    Called from
    C:\Inetpub\wwwroot\Scorecard33\fusebox5\fusebox5.cfm: line 57
    Called from C:\Inetpub\wwwroot\Scorecard33\index.cfm: line 3
    80 : <cfset MyCSV.update(EID, ccfLevel, CCFRole,
    CCFTeamID,CCFlocationID, status,
    81 : CSGID, SalesRep_id, Peoplesoftid, AvayaID,
    82 : first_name, mi, last_name, hiredate, CCFBossEID)>
    83 : <cfelse>
    84 : <li>Adding...</li>

    quote:
    Originally posted by:
    emmim44
    They said leave it null or blank... depends on db ...
    Also, even I set a default value for status, how come
    'Work_status' is not being updated with the default value = 'FTE'
    <cfargument name="status" type="string" required="false"
    default="FTE">
    <cfif arguments.status NEQ "">
    Work_status = <cfqueryparam cfsqltype="CF_SQL_CHAR"
    value="#arguments.status#">,
    <cfelse>
    Work_status = '#arguments.status#',
    </cfif>
    Kronin555's earlier reply explains it.

  • Error executing CFC. Parameter index out of range (2 number of parameters, which is 1)

    Hi,
    My CFC component is defined as:
    <cffunction name="updateNote" output="false" access="remote"  returntype="void" >
         <cfargument name="notedetails" required="true" type="string" >
         <cfargument name="notename" required="true" type="string" />
         <cfquery name="qupdateNote" datasource="notes_db">
               UPDATE
                   notes
               SET
                   notes.notedetails=<CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#ARGUMENTS.notedetails#">,
               WHERE
                   notename="<CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#ARGUMENTS.notename#">"
        </cfquery>
    </cffunction>
    In Flash builder when I test the operation I get this error:
    "There was an error while invoking the operation. Check  your server settings and try invoking the operation again.
    Reason:  Server error Unable to invoke CFC - Error Executing Database Query. Parameter  index out of range (2 > number of parameters, which is 1)."
    Im really quessing that this is something small but right now its causing me to pull my hair out of my head!! Argg. Tried a bunch of things but I know thik im stuck.
    Help would be very very appreciated.
    Thanks

    Create test.cfm along these lines:
    <cfset myObj = createObject("component", "dotted.path.to.cfc.file")>
    <cfset myResult = myObj.myMethod(arg=value1, etc)>
    <cfdump var="#myResult#">
    Or, really, you could just browse to this:
    http://your.domain/path/to/your.cfc?method=yourMethod&arg1=value1 [etc]
    Although I dunno which of those two approachs will give you a better error message (indeed, it might be the same).
    Try both.
    Adam

  • Error when inserting more than 500 characters

    Hello all,
    I am not sure if I should be posting here or in the Flex
    Forum, so I apologize ahead of time if I am in the wrong place.
    I am Using a Flex frontend and a ColdFusion backend to edit
    data in a simple Access Database (for testing). I have a ColdFusion
    CFC on the backend that handles everything just fine until I enter
    in more than 500 characters (Actually 510) into my text area and
    then I get the error "Unable to invoke CFC - Error Executing
    Database Query.". Now you might be saying that either the database
    field is not set to handle that many characters or the CFC is
    restricting more than 500 characters, but they are not. The
    database field is set to "memo" and the maxlength in the CFC is set
    to 5000. I am wondering if has something to do with Access
    databases I do not know because I don't use them that often.
    I have tested this over and over and it only throws the error
    if I exceed 510 characters in the Flex TextArea.
    Any thoughts are appreciated.
    The CFC code is below I didn't add the MXML because I figured
    there was nothing special about the TextArea block:

    Very strange as to why this worked but just in case someone
    else has the same problem here is how I got it to work.
    I just changed this line:
    rss_copy = <cfqueryparam value="#arguments.rss_copy_edit#"
    cfsqltype="cf_sql_varchar" maxlength="5000">
    to this:
    rss_copy = '#arguments.rss_copy_edit#"'
    and it worked just fine.

  • Error when sending more than 500 Characters

    Hello all,
    I am not sure if I should be posting here or in the
    ColdFusion Forum, so I apologize ahead of time if I am in the wrong
    place.
    I am Using a Flex frontend and a ColdFusion backend to edit
    data in a simple Access Database (for testing). I have a ColdFusion
    CFC on the backend that handles everything just fine until I enter
    in more than 500 characters (Actually 510) into my text area and
    then I get the error "Unable to invoke CFC - Error Executing
    Database Query.". Now you might be saying that either the database
    field is not set to handle that many characters or the CFC is
    restricting more than 500 characters, but they are not. The
    database field is set to "memo" and the maxlength in the CFC is set
    to 5000. I am wondering if has something to do with Access
    databases I do not know because I don't use them that often.
    I have tested this over and over and it only throws the error
    if I exceed 510 characters in the Flex TextArea.
    Any thoughts are appreciated.
    The CFC code is below I didn't add the MXML because I figured
    there was nothing special about the TextArea block:

    The code should be in my initial post.
    Very strange as to why this worked but just in case someone
    else has the same problem here is how I got it to work.
    I just changed this line:
    rss_copy = <cfqueryparam value="#arguments.rss_copy_edit#"
    cfsqltype="cf_sql_varchar" maxlength="5000">
    to this:
    rss_copy = '#arguments.rss_copy_edit#"'
    and it worked just fine.
    Not the best solution but it works fine now all the
    same.

  • Cannot find CFC

    All, I am receiving a CANNOT FIND CFC error when trying to
    run this app. This is my first Flex app and I am simply trying to
    bind a query result from a CFC to a datagrid.
    Here's my code. I have verified the CFC is there and works.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="initApp();">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    public function initApp():void{
    qryUsers.selectAll();
    [Bindable]
    public var myResult:Object;
    public function myMethodResult(event):void {
    myResult = event.result;
    ]]>
    </mx:Script>
    <mx:RemoteObject id="qryUsers" source="employees"
    destination="ColdFusion">
    <mx:method name="selectAll"
    result="myMethodResult(event)" />
    </mx:RemoteObject>
    <mx:Panel width="90%" height="90%" cornerRadius="5"
    title="Employee Phone List" horizontalAlign="center"
    verticalAlign="middle" horizontalCenter="3" verticalCenter="5">
    <mx:DataGrid x="10" y="10" width="100%" height="100%"
    id="employeeList" dataProvider="{myResult}">
    <mx:columns>
    <mx:DataGridColumn headerText="First Name"
    dataField="column1" />
    <mx:DataGridColumn headerText="Last Name"
    dataField="column2"/>
    <mx:DataGridColumn headerText="E-Mail"
    dataField="column3"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Panel>
    </mx:Application>

    I figure it's best to show the full sample as below. Notice
    that I scope private variables with the '_'... this you will
    appriciate as you get more advanced. I can't confirm the actual run
    of this as I do not have the cfc nor the database you have. Also,
    check those column dataFields.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="initApp()">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable] private var _myResult:ArrayCollection;
    private function initApp():void{
    qryUsers.selectAll();
    private function myMethodResult(event:ResultEvent):void {
    _myResult = event.result as ArrayCollection;
    ]]>
    </mx:Script>
    <mx:RemoteObject id="qryUsers" source="employees"
    destination="ColdFusion">
    <mx:method name="selectAll"
    result="myMethodResult(event)" />
    </mx:RemoteObject>
    <mx:Panel width="90%" height="90%" cornerRadius="5"
    title="Employee Phone List" horizontalAlign="center"
    verticalAlign="middle" horizontalCenter="3" verticalCenter="5">
    <mx:DataGrid x="10" y="10" width="100%" height="100%"
    id="employeeList" dataProvider="{_myResult}">
    <mx:columns>
    <mx:DataGridColumn headerText="First Name"
    dataField="column1" />
    <mx:DataGridColumn headerText="Last Name"
    dataField="column2"/>
    <mx:DataGridColumn headerText="E-Mail"
    dataField="column3"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Panel>
    </mx:Application>

  • CFC DB Inserts and calculations

    I keep getting a DB CFC error. For some reason CF freaks out
    when I enter negative numbers into a flash form an pass it to a CFC
    has anyone else had this problem before? If so can anyone help me
    figure this out. Again it only freaks out when I enter negative
    numbers (example: -28).
    Sample Code:

    oh is a CFC error which is pointing to the Database insert
    query, and yes I do realize that the code I posted has it comment
    out but this is not like this on the original file, I think the
    issue is that coldfusion has issues doing calculations on negative
    numbers, it should not but this seems to be the case. I even try
    doing a number format but that won't work because of "-"
    sign.

  • Problem with SQL Insert

    Hi
    I am using Flex to insert data through remoteobject and using
    SAVE method generated from CFC Wizard.
    My VO contains the following variables where id has a default
    value of 0 :
    public var id:Number = 0 ;
    public var date:String = "";
    public var accountno:String = "";
    public var debit:Number = 0;
    public var credit:Number = 0;
    id is set as the primary key in my database.
    I have previously used MySQL which automatically generates a
    new id if I either omitted the id value in my insert statement or
    use 0 as the default value.
    However, now I am using MS SQL Server and the insert
    generated this error:
    Unable to invoke CFC - Error Executing Database Query.
    Detail:
    [Macromedia][SQLServer JDBC Driver][SQLServer]Cannot insert
    explicit value for identity column in table 'Transactions' when
    IDENTITY_INSERT is set to OFF.
    Strange thing is that I dont see this problem with another
    sample application. I compared with that application (it has the
    same VO with default value of 0 for id) and everything looks
    similar so I can't understand why I have this error in my
    application.
    This is SQL used to create the table:
    USE [Transactions]
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    SET ANSI_PADDING ON
    CREATE TABLE [dbo].[Transactions](
    [id] [int] IDENTITY(1,1) NOT NULL,
    [date] [datetime] NULL,
    [accountno] [varchar](100) NULL,
    [debit] [int] NULL,
    [credit] [int] NULL,
    CONSTRAINT [PK_Transactions] PRIMARY KEY CLUSTERED
    [id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE =
    OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
    ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    Has anyone encountered this problem before with insert
    statements dealing with a unique id (with MS SQL Server)?

    Change "addRecords =
    connection.prepareStatement("
    to "addRecords =
    connection.preparedStatement("
    -BIGD

  • How do I find the number of users returned by a cfldap query?

    How do I find the number of users returned by a cfldap query?
    I'm not allowed to do something like:
    <cfif ArrayLen(results.rows) gt 1>
    I then get an error:
    faultCode:Server.Processing faultString:'Unable to invoke CFC - Object of type class coldfusion.tagext.net.LdapResultTable cannot be used as an array' faultDetail:''
    Many thanks for any light you can shed

       Cheers again Ian for your many helps,
    it now won't let me do
    <cfqueryparam value="#results.USNCreated#" cfsqltype="cf_sql_varchar">
    I get the message:
    faultCode:Server.Processing faultString:'Unable to invoke CFC - Error Executing Database Query.' faultDetail:'[Macromedia][SQLServer JDBC Driver][SQLServer]The name "results.USNCreated" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.'

Maybe you are looking for