Created
November 12, 2013 19:43
-
-
Save mhenke/7437380 to your computer and use it in GitHub Desktop.
awesome query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<CFQUERY DATASOURCE='#DataSource#' USERNAME='#DataUserName#' PASSWORD='#DataPassWord#' NAME="output"> | |
<cfif isdefined("variable.csd_id")> | |
select h.csm_id, h.csh_id, h.csc_id, h.css_id, h.csd_id, h.PageTitle, h.WebText, h.Keywords, h.RightBarDisplay, h.pageURL | |
from chambersitedetail h | |
where h.csd_id = <cfqueryparam cfsqltype="integer" value="#variable.csd_id#"> and h.csm_id = 1 | |
<cfelseif isdefined("variable.css_id")> | |
select h.csm_id, h.csh_id, h.csc_id, h.css_id, h.PageTitle, h.WebText, h.Keywords, h.RightBarDisplay, h.pageURL | |
from chambersitesubcategory h | |
where h.css_id = <cfqueryparam cfsqltype="integer" value="#variable.css_id#"> and h.csm_id = 1 | |
<cfelseif isdefined("variable.csc_id")> | |
select h.csm_id, h.csh_id, h.csc_id, h.PageTitle, h.WebText, h.Keywords, h.RightBarDisplay, h.pageURL | |
from chambersitecategory h | |
where h.csc_id = <cfqueryparam cfsqltype="integer" value="#variable.csc_id#"> and h.csm_id = 1 | |
<cfelseif isdefined("variable.csh_id")> | |
select h.csm_id, h.csh_id, h.PageTitle, h.WebText, h.Keywords, h.RightBarDisplay, h.pageURL | |
from chambersiteheader h | |
where h.csh_id = <cfqueryparam cfsqltype="integer" value="#variable.csh_id#"> and h.csm_id = 1 | |
<cfelse> | |
select h.csm_id, h.PageTitle, h.WebText, h.Keywords, h.RightBarDisplay, h.pageURL | |
from chambersitemaster h | |
where h.csm_id = 1 | |
</cfif> | |
</CFQUERY> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using username, password.
using cfelseif instead of switch