Personaly I would dynamically create the SQL statement in a SQL SP rather
than CF.  The main reason I'd do this is because SQL will give you far more
flexibility than CF.  I have no idea if there are any performance issues

-----Original Message-----
From: Eberhart, Robert D [mailto:[EMAIL PROTECTED]]
Sent: 17 August 2000 13:21
To: [EMAIL PROTECTED]
Subject: Noodling over Switch Statements and Stored Procedures and
Efficie ncy


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C00845.929A8660
Content-Type: text/plain;
        charset="iso-8859-1"

I'm just trying to gauge whether this will work or not and still be
efficient.  We have a simple search form that allows users to search through
a database of items.  The form gives the users a series of options from
which they can pick and thus refine their searches.  Now, the stored
procedure that provides the engine of this search has a bunch of conditional
logic that leads to a different SQL statement based on the options that the
user has picked.  

I wanted to refine this a little bit and make it a bit more efficient.  My
idea was to dynamically generate a SQL statement in CF using a series of
nested switch statements, which to my knowledge are a bit more efficient
than CFIF, and then pass the query string into the stored procedure for
execution and allow the stored procedure to perform the remaining bit of
processing needed on the retrieved information.  Is this a valid line of
thinking, or should I just leave well enough alone?

Sincerely,
Robert Eberhart

------_=_NextPart_001_01C00845.929A8660
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2652.35">
<TITLE>Noodling over Switch Statements and Stored Procedures and =
Efficiency</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>I'm just trying to gauge whether this will work or =
not and still be efficient.&nbsp; We have a simple search form that =
allows users to search through a database of items.&nbsp; The form =
gives the users a series of options from which they can pick and thus =
refine their searches.&nbsp; Now, the stored procedure that provides =
the engine of this search has a bunch of conditional logic that leads =
to a different SQL statement based on the options that the user has =
picked.&nbsp; </FONT></P>

<P><FONT SIZE=3D2>I wanted to refine this a little bit and make it a =
bit more efficient.&nbsp; My idea was to dynamically generate a SQL =
statement in CF using a series of nested switch statements, which to my =
knowledge are a bit more efficient than CFIF, and then pass the query =
string into the stored procedure for execution and allow the stored =
procedure to perform the remaining bit of processing needed on the =
retrieved information.&nbsp; Is this a valid line of thinking, or =
should I just leave well enough alone?</FONT></P>

<P><FONT SIZE=3D2>Sincerely,</FONT>
<BR><FONT SIZE=3D2>Robert Eberhart</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C00845.929A8660--
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to