Would the join of the two tables improve performance?

Thanks,
Donna

On Thu, 7 Oct 2004 14:19:34 -0500, Aaron Rouse <[EMAIL PROTECTED]> wrote:
> Why don't you just join your two tables within your query and avoid
> the need for a switch/case?  And if no recordcount then display the
> default template.
>
> On Thu, 7 Oct 2004 14:02:49 -0500, Donna French <[EMAIL PROTECTED]> wrote:
> > Okay, here's what I've come up with so far. Let me know any comments -
>
>
> > good, bad or indifferent.
> >
> > <cfquery name="rsDetails" datasource="#dsn#">
> >  SELECT *
> >  FROM tblProducts
> >  WHERE ProdID = #URL.ProdID#
> > </cfquery>
> >
> > <cfoutput query="rsDetails" datasource="#dsn#">
> > <cfswitch _expression_="#Trim(TypeID)#">
> >  <cfcase value="1">
> >    <!--- Display layout for TypeID 1 --->
> >        <cfquery name="rsType1" datasource="#dsn#">
> >          SELECT *
> >          FROM tblTypes
> >          WHERE TypeID = 1
> >        </cfquery>
> >        <cfoutput query="rsType1">
> >          #Trim(TypeDesc)#
> >        </cfoutput>
> >  </cfcase>
> >  <cfcase value="2">
> >    <!--- Display layout for TypeID 2 --->
> >    <cfquery name="rsType2" datasource="#dsn#">
> >      SELECT *
> >      FROM tblTypes
> >      WHERE TypeID = 2
> >    </cfquery>
> >    <cfoutput query="rsType2">
> >      #Trim(TypeDesc)#
> >    </cfoutput>
> >  </cfcase>
> >  <cfcase value="3">
> >    <!--- Display layout for TypeID 3 --->
> >    <cfquery name="rsType3" datasource="#dsn#">
> >      SELECT *
> >      FROM tblTypes
> >      WHERE TypeID = 3
> >    </cfquery>
> >    <cfoutput query="rsType3">
> >      #Trim(TypeDesc)#
> >    </cfoutput>
> >  </cfcase>
> >  <cfdefaultcase>
> >        <!--- Display default layout --->
> >        <cfinclude template="defaultdetails.cfm">
> >  </cfdefaultcase>
> > </cfswitch>
> > </cfoutput>
> >
> > TIA,
> > Donna
> >________________________________
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to