2 Replies Latest reply on Oct 8, 2007 4:04 AM by Newsgroup_User

    Simply Help

    Level 7
      I am trying to grab the files names that are in the database and then loop
      over that list to use cfhttp to create queries which I then join to create
      one master query to select all the distict cities from the list. I am
      calling the function 'Cities'

      There are 7 files names in the database (idxrs093007.txt, idxrs100107.txt,
      idxrs100207.txt, idxrs100307.txt, idxrs100407.txt, idxrs100507.txt,
      idxrs100607.txt) which I want to loop through and populate the cfhttp url

      Anyone see anything glaring on why this doesn't work and what can I change
      to make it work. Thanks

      <cffunction name="getFileNames" access="public" returntype="query"
      output="false" hint="I get the various file names from the database">
      <cfargument name="tableName" type="string" required="yes">
      <cfquery name="fileNames" datasource="bpopros">
      Select *
      from #tableName#
      <cfreturn fileNames>

      <!---Get Cities--->
      <cffunction name="Cities" access="public" returntype="query"
      output="false" hint="I join all the Residentials">
      <cfset files = getFileNames('ResFiles')>
      <cfset i = 0>
      <cfloop query="files">
      <cfset i = i + 1>
      url=" http://www.bpoprosonline.com/assets/property/#files.fileName#"
      method="GET" name="Res#i#" delimiter="|"
      textqualifier="" firstrowasheaders="yes" />
      <cfquery name="Cities" dbtype="query">
      SELECT DISTINCT(A.city, B.City, C.City, E.City, F.City, G.City)
      FROM Res1 A, Res2 B,Res3 C,Res4 D,Res5 E,Res6 F,Res7 G
      <cfreturn Cities>

      Wally Kolcz
      Founder / Developer