Yes, but you have to do more with the stored proc code. You must use a CASE
statement... here's an example:
Pass in a varchar(15) called Sort and assign it as @sort. Then, in your
Order by clause:
ORDER BY
CASE @sort2 WHEN 'lname' then lname
WHEN 'fname' then lname
WHEN 'location' then location
WHEN 'area' then area
etc. You get the idea - it's more SQL code, and you have to know the
possible sorts in advance.
Mark
-----Original Message-----
From: stas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 03, 2002 6:53 AM
To: CF-Talk
Subject: Dynamic stored procs
I have a dynamically generated ORDER BY clause (as in ORDER BY
#attributes.orderByClause# ). Is there a way to pass that on to a stored
procedure if I wanted to convert a <cfquery> to <cfstoredproc>? Thanks!
_________________________
_________________________
____________________
Why Share?
Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB
MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
______________________________________________________________________
Why Share?
Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists