Skip to main content
Inspiring
July 20, 2009
Question

Cffunction error

  • July 20, 2009
  • 1 reply
  • 1436 views

The argument TEAM passed to function SearchRes() is not of type numeric.

If the component name is specified as a type of this argument, the reason for this error might be that a definition file for such component cannot be found or is not accessible.
The error occurred in C:\Inetpub\wwwroot\search.cfc: line 4
2 : 
3 :      <cffunction name="SearchRes" access="public" returntype="query">
4 :        <cfargument name="DSN" type="string" required="yes">
5 :     <cfargument name="Role" type="string" required="no">
6 :     <cfargument name="Team" type="numeric" required="no">

Please look at the above error...any help app...

code ------------------------->

<cfcomponent hint="This cfc does search...">

<cffunction name="SearchRes" access="public" returntype="query">
   <cfargument name="DSN" type="string" required="yes">
    <cfargument name="Role" type="string" required="no">
    <cfargument name="Team" type="numeric" required="no">
    <cfargument name="Level" type="numeric" required="no">
   
    <cfargument name="zone" type="numeric" required="no">
    <cfargument name="Dept" type="numeric" required="no">
    <cfargument name="location" type="numeric" required="no">
   
    <cfargument name="csgid" type="string" required="no">
    <cfargument name="status" type="string" required="no">
    <cfargument name="filter" type="string" required="no">
    <cfargument name="bosseid" type="string" required="no">
       <cfdump var="#arguments#">    
      <cfquery datasource="#arguments.DSN#" name="SearchRes">
        Select
          r.First_name,
          r.Last_name,
          r.EID,
          r.tech_id,
          r.title,
          r.hire_date,
          r.rehire_date,
          l.location,
          d.department
        from
          OPS$RMS.REF_resource r,
          OPS$RMS.Ref_department d,
          OPS$RMS.REF_Location l
        where
          r.location_code = l.location_code
          And r.department_code = d.department_code
         
          <cfif arguments.role neq "">
           And r.role_code = '#arguments.role#'
          </cfif>
          <cfif arguments.Team neq "">
           And r.team_code = #arguments.team#
          </cfif>
          <cfif arguments.level neq "">
           And r.level_code = #arguments.level#
          </cfif>
          <cfif arguments.zone neq "">
           --And r.zone_code = #arguments.zone#
          </cfif>
         
          <cfif arguments.dept neq "">
           And r.department_code = #arguments.dept#
          </cfif>
          <cfif arguments.location neq "">
           And r.location_code = #arguments.location#
          </cfif>
          <cfif arguments.csgid neq "">
           And r.csg_operator_id like '#arguments.csgid#%'
          </cfif>
          <cfif arguments.status neq "">
           And r.status = '#arguments.status#'
          </cfif>
          <cfif arguments.filter neq "">
            And
            (
            r.EID = '#arguments.filter#%'
            OR r.First_name like '#arguments.filter#%'
            OR r.last_name like '#arguments.filter#%'
            OR r.tech_id like '#arguments.filter#%'
            )
          </cfif>
          <cfif arguments.bosseid neq "">
           And r.boss_id = '#arguments.bosseid#%'
          </cfif>
             
      </cfquery>  
      <cfreturn SearchRes>
</cffunction>

</cfcomponent>

This topic has been closed for replies.

1 reply

Inspiring
July 20, 2009

emmim44 wrote:


The argument TEAM passed to function SearchRes() is not of type numeric.

The error message seems quite clear.  The value you are passing in for TEAM argument is not numeric.

emmim44Author
Inspiring
July 20, 2009

I checked it is... these fields are coming from a search page... all of them can be null....or any of them

Inspiring
July 20, 2009

Can you show the code where you call the function? Are you passing the arguments in as an argument collection or individually?

Might not be an issue but, while your Team variable can be null, the cfargument tag types the variable as a numeric value (as opposed to any or whatever). Depending on what you're supplying this could be a source of the error.