|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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> |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > sql statemen with multiple inner joins |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|