2 Replies Latest reply on Mar 17, 2010 2:13 PM by emmim44

    QueryNew

    emmim44 Level 1

      Hi guyz,

      I am looping thru a read of xls records (POI.cfc) and inserting any warning or error into a session.querynew object... some how come some of elements of querynew object comes as empty even though there enough warnings... Any help appreciated..

       

           <cfloop query="myResultSet.query">
               <cfif column6 eq "">
               <cfset newRow = QueryAddRow(session.myQuery)>
               <cfset temp = QuerySetCell(session.myQuery, "EID", "#column1#", counterQuery)>
               <cfset temp = QuerySetCell(session.myQuery, "Message",
                " doesnt have a Department", counterQuery)>
              <cfelse>
               <cfset ValDept = Validate.Dept(application.orc,#column6#)>
               <cfif ValDept.recordcount gt 0>
                <cfset DCode= ValDept.dep>
               <cfelse>
                <cfset newRow = QueryAddRow(session.myQuery)>
                <cfset temp = QuerySetCell(session.myQuery, "EID",
                 "#column1#", counterQuery)>
                <cfset temp = QuerySetCell(session.myQuery, "Message",
                 " Department <i>"& column6
                & "</i> doesnt exist in Database<br>", counterQuery)>        
               </cfif>
              </cfif>
            

              <cfif column7 eq "">
               <cfset newRow = QueryAddRow(session.myQuery)>
               <cfset temp = QuerySetCell(session.myQuery, "EID",
                "#column1#", counterQuery)>
               <cfset temp = QuerySetCell(session.myQuery, "Message",
                " doesnt have a Location", counterQuery)>           
              <cfelse>
               <cfset ValLoc = Validate.Loc(application.orc,#column7#)>
               <cfif ValLoc.recordcount gt 0>
                <cfset LCode= ValLoc.loc>
               <cfelse>
                <cfset newRow = QueryAddRow(session.myQuery)>
                <cfset temp = QuerySetCell(session.myQuery, "EID",
                 "#column1#", counterQuery)>
                <cfset temp = QuerySetCell(session.myQuery, "Message",
                 " Location <i>"& column7
                & "</i> doesnt exist in Database<br>", counterQuery)>         
                </cfif>
              </cfif>

           <cfset counterQuery = counterQuery + 1>

      </cfloop>