ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 4th, 2011, 01:18 PM
frapple frapple is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 70 frapple User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 56 m 56 sec
Reputation Power: 0
Simple Loop Query

Have been on this project too long ... trying to reconcile credit card batch statement line items to actual orders. Data tables is on different dsn's.

The parent query loads fine:
<cfquery datasource="#request.datasource#" name="recon">
SELECT *
FROM Commerce
WHERE
(ID >= #(form.startdate)#) AND (ID <= #(form.enddate)#)
Order By ID
</cfquery>

<cfoutput query="recon">

<cfquery name="reg" datasource="data2">
SELECT *
FROM Alpiner
WHERE Extra3 = '#recon.extra3#'
Order By Extra3
</cfquery>


<table width="800" cellspacing="4" cellpadding="4" summary="" border="0">
<tbody>
***********data from recon **************

now want to display child records for each line above directly underneath each parent.

</cfoutput>


<cfoutput query="reg">

<tr>
<td>



#s1fname# #extra3#</td></tr></cfoutput></tbody></table>

In a nutshell ... Data from Commerce table alternating with data from Alpiner table ... have tried looping joins ... major league code blindness coupled with serious brain fart.

Cheers ....

Reply With Quote
  #2  
Old October 4th, 2011, 03:34 PM
cfSearching cfSearching is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 117 cfSearching User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 16 m 2 sec
Reputation Power: 6
Quote:
Originally Posted by frapple
Data tables is on different dsn's.


All you should need is a JOIN. Depending on your database type and permissions, it may be possible to do it directly. Otherwise, try doing the JOIN in a QoQ.

Quote:
(ID >= #(form.startdate)#) AND (ID <= #(form.enddate)#)


I am guessing that is psuedo-code ... But if you are really not using cfqueryparam - you should start. At the very least to help protect your financial data against sql injection.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Simple Loop Query

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap