ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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 May 3rd, 2005, 09:23 AM
andy11983 andy11983 is offline
Newbie wannabe extrodanaire
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: stoke
Posts: 315 andy11983 User rank is Corporal (100 - 500 Reputation Level)andy11983 User rank is Corporal (100 - 500 Reputation Level)andy11983 User rank is Corporal (100 - 500 Reputation Level)andy11983 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 9 h 25 m 6 sec
Reputation Power: 6
sql statemen with multiple inner joins

Hi,

I was wondering if there were are sql/colfusion gurus that can help me please. Im trying to make this sql statement to be in proper coldfusion syntax and am stuck(as i newbie to coldfusion) and appreciate any and all help

Thanks

Andy


Code:
<cfquery name="AttachedToTextCount" datasource="#caller.nimoirdb#" maxrows="1">
SELECT count(LnA.ID) FROM links LnA
  INNER JOIN pageHasText phT on LnA.id = phT.linkID
  INNER JOIN itemPage pA on phT.pageID = pA.id
  INNER JOIN tracking tA on pA.trackingID = tA.id

WHERE (LnA.linkType = "download" AND LnA.linkTo = <cfparam name="#objectID#" cfsqltype="CF_SQL_CHAR"> AND tA.status  NOT IN "removed", "purged")

</cfquery>

Reply With Quote
  #2  
Old May 3rd, 2005, 09:32 AM
cfcoyote cfcoyote is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 9 cfcoyote User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 14 m 52 sec
Reputation Power: 0
Well 1st cfparam will mess you up it should be
Code:
 <cfqueryparam 
                        value="#LastName#" 
                        cfsqltype="CF_SQL_VARCHAR" 
                        maxlength="17"> 

Also max rows not needed count will return only 1 result

Mark Holm
Comments on this post
kiteless agrees!

Reply With Quote
  #3  
Old May 3rd, 2005, 09:58 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
Mark is right on both counts (no pun intended...har har).
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #4  
Old May 4th, 2005, 04:00 AM
andy11983 andy11983 is offline
Newbie wannabe extrodanaire
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: stoke
Posts: 315 andy11983 User rank is Corporal (100 - 500 Reputation Level)andy11983 User rank is Corporal (100 - 500 Reputation Level)andy11983 User rank is Corporal (100 - 500 Reputation Level)andy11983 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 9 h 25 m 6 sec
Reputation Power: 6
Thanks for your help guys.

Iv'e made the chanegs that you suggested - is that everything or is there more that needs to be done?

Thanks again for your help

Andy

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > sql statemen with multiple inner joins


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT