23 Replies Latest reply on Jun 25, 2008 10:24 PM by BKBK

    The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or

    lovely_raj12
      I have taken the cfdump for tmpqry and it shows all data for the range ( No error at this step ) . But when we exceute this dbquery we get below mentioned error .

      <cfquery name="qry" dbtype="query" >
      SELECT *
      FROM tmpqry
      ORDER BY #arguments.colSort# ASC
      </cfquery>

      senerio:

      I am using createobject to create a reference for component and call MDArraySort function in the cfc and getting this error .

      'The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.

      Null pointer is undefined.... '

      i am using this code in a cfc file.

      <cffunction name="MDArraySort" Returntype="query" access="public" >
      <cfargument name="colArray" type="array" required="true">
      <cfargument name="colNames" type="string" required="true">
      <cfargument name="colSort" type="string" required="true">
      <cfargument name="sensorIDs" type="string" required="true">

      <cfscript>
      var tmpqry = Querynew(arguments.colNames);
      var qRow = QueryAddRow(tmpqry, Arraylen(arguments.colArray) );
      </cfscript>

      <cfloop from="1" to="#Arraylen(arguments.colArray)#" index="qRowIndex">

      <cfscript>

      sIndexinSensorIDs = colArray[qRowIndex]["SENSOR"]&"##";
      Temp_readin_code = colArray[qRowIndex]["READING_CODE"]&"##";

      QuerySetCell(tmpqry, 'SENSOR', sIndexinSensorIDs, qRowIndex);
      QuerySetCell(tmpqry, 'TYPE',javacast('String',colArray[qRowIndex]["TYPE"]), qRowIndex);
      QuerySetCell(tmpqry, 'TIMESTAMP2', LSParseDateTime(colArray[qRowIndex]["TIMESTAMP2"]), qRowIndex);
      QuerySetCell(tmpqry, 'ORDER_BY_PARAM',javacast('String',colArray[qRowIndex]["ORDER_BY_PARAM"]), qRowIndex);
      QuerySetCell(tmpqry, 'READING_CODE',Temp_readin_code , qRowIndex);
      QuerySetCell(tmpqry, 'READING',javacast('String',colArray[qRowIndex]["READING"]), qRowIndex);
      QuerySetCell(tmpqry, 'PK_READING',javacast('String',colArray[qRowIndex]["PK_READING"]), qRowIndex);
      QuerySetCell(tmpqry, 'ALARM_STATUS',javacast('String',colArray[qRowIndex]["ALARM_STATUS"]), qRowIndex);
      QuerySetCell(tmpqry, 'DURATION', javacast('String',colArray[qRowIndex]["DURATION"]), qRowIndex);
      QuerySetCell(tmpqry, 'DESCRIPTION',javacast('String',colArray[qRowIndex]["DESCRIPTION"]), qRowIndex);

      </cfscript>
      </cfloop>

      <cfquery name="qry" dbtype="query" >
      SELECT *
      FROM tmpqry
      ORDER BY #arguments.colSort# ASC
      </cfquery>

      <cfreturn qry >

      </cffunction>

      It is working fine for some date range and and getting above mentioned error in sone situation .