• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Simply Help

LEGEND ,
Oct 07, 2007 Oct 07, 2007

Copy link to clipboard

Copied

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
string.

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#
</cfquery>
<cfreturn fileNames>
</cffunction>

<!---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">
<cfoutput>
<cfset i = i + 1>
<cfhttp
url=" http://www.bpoprosonline.com/assets/property/#files.fileName#"
method="GET" name="Res#i#" delimiter="|"
textqualifier="" firstrowasheaders="yes" />
</cfoutput>
</cfloop>
<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
</cfquery>
<cfreturn Cities>
</cffunction>

--
Wally Kolcz
MyNextPet.org
Founder / Developer
586.871.4126


TOPICS
Advanced techniques

Views

196

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 07, 2007 Oct 07, 2007

Copy link to clipboard

Copied

There seems to be a q of q problems. Any ideas?

Query Of Queries syntax error.
Encountered ",. Incorrect Select List,


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 08, 2007 Oct 08, 2007

Copy link to clipboard

Copied

LATEST
Never mind. Figured it out. Was using a join when I needed a Union. Works
great now.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation