Coldfusion& SQL Server 2000 : How to save query information when using drill downs

Status
Not open for further replies.

Flipside79

Ars Tribunus Angusticlavius
9,365
I am pretty new to Coldfusion, and this is still the first implementation of it for me, so be gently. I am trying to implent a drill down interface of sorts. Bascially the initial search shows a list of results, and the results become a link, which if clicked shows the complete information. So what i did was did 1 query on the first page, and then for the second page I requeried all the info using URL variables. This worked fine when I had a few records, but now that I have a lot of records, the queries are really taking a while. It is not so bad having to wait for the first query, but then when I do the drill down, it is doing the whole search over again, and taking a ton of time.

The two query pages I am using are below....


Initial Page
--------------------------
Code:
<cfquery datasource="search"
name="q_fein">
Select fein.fein, fein.case_duns, fein.business_state, fein.business_city, aos.subject_duns_a, 
aos.business_name_a, fein.business_name, fein.business_address, fein.source_duns
From fein, aos
Where fein = '#form.fein#'
And case_duns = subject_duns_a
</cfquery>
<table border="2" bordercolor="yellow">
<tr>
<th>Business Name</th>
<th>City</th>
<th>State</th>
</tr>
<cfoutput query="q_fein">

<tr>
<td><a href="bkpfeindetail.cfm?fein=#q_fein.fein#&business_name=#urlencodedformat(q_fein.business_name)#&business_address=#urlencodedformat(q_fein.business_address)#&source_duns=#q_fein.source_duns#&business_city=
#q_fein.business_city#&business_state=#q_fein.business_state#">
#business_name#</a></td>
<td>#business_city#</td>
<td>#business_state#</td>
</tr>
</cfoutput>
</table> 
<a href="bkpfein.cfm">Click Here to Re-Query</a>

Drill Down Page
-------------------
Code:
 <cfquery datasource="search"
name="q_feindet">
Select fein.fein, fein.case_duns, fein.business_name, fein.business_address, fein.business_city,
 fein.business_state, fein.zip, fein.source_duns, aos.subject_duns_a, aos.business_name_a, aos.business_phone_a,
 aos.ceo_title_a, aos.sic_code_a, aos.parent_duns_a, aos.hq_duns_a, aos.dba_a, aos.foreign_duns_a 
From fein, aos
Where fein = '#url.fein#'
And business_name = '#url.business_name#'
And business_address = '#url.business_address#'
And business_city = '#url.business_city#'
And business_state = '#url.business_state#'
And source_duns = '#url.source_duns#'
And case_duns = subject_duns_a
</cfquery>
<h2><B>FEIN DATA</B></h2>
<cfoutput query="q_feindet">
<table border="2" bordercolor="yellow">
<tr>
<th>FEIN</th>
<th>Case Duns</th>
<th>Business Name</th>
<th>Address</th>
<th>City</th>
<th>State</th>
<th>Zip</th>
<th>Source Duns</th>
</tr>
<tr>
<td>#fein#</td>
<td>#case_duns#</td>
<td>#business_name#</td>
<td>#business_address#</td>
<td>#business_city#</td>
<td>#business_state#</td>
<td>#zip#</td>
<td>#source_duns#</td>

</tr>

</table>

</cfoutput>


<hr size="2" color="Navy">

<h2><B>AOS DATA</B></h2>
<cfoutput query="q_feindet">

<table border="2" bordercolor="yellow">
<tr>
<th>Business Name</th>
<th>DBA</th>
<th>Phone</th>
<th>CEO</th>
<th>SIC Code</th>
<th>Parent DUNS</th>
<th>HQ Duns</th>
<th>Foreign DUNS</th>
</tr>
<tr>
<td>#business_name_a#</td>
<td>#dba_a#</td>
<td>#business_phone_a#</td>
<td>#ceo_title_a#</td>
<td>#sic_code_a#</td>
<td>#parent_duns_a#</td>
<td>#hq_duns_a#</td>
<th>#foreign_duns_a#</th>

</table>
</cfoutput>

<hr size="2" color="Navy">

So how can I work this so that it saves all of the info from the first query, and then I can just display it on the second page(I can instead query everything on the first page and only display some on the first page, but all on the second)

[This message was edited by Flipside79 on March 14, 2002 at 15:57.]
 
Status
Not open for further replies.