Subject | Stored procedure question - can this be done? |
---|---|
Author | myles@techsol.org |
Post date | 2006-07-14T02:51:40Z |
I want to be able to programmatically change the sorted order of SELECT
statements executed in a stored procedure, based on an input value passed to
the SP. Without creating a mound of IF ELSE statements, is there a way to
somehow have the statement:
ORDER BY <column> ASCENDING
Be represented as:
ORDER BY <column> <direction>
By passing the column and direction values as references to the INPUT
variables to the SP?
Myles
============================
Myles Wakeham
Director of Engineering
Tech Solutions US, Inc.
Scottsdale, Arizona USA
Phone (480) 451-7440
www.techsol.org
statements executed in a stored procedure, based on an input value passed to
the SP. Without creating a mound of IF ELSE statements, is there a way to
somehow have the statement:
ORDER BY <column> ASCENDING
Be represented as:
ORDER BY <column> <direction>
By passing the column and direction values as references to the INPUT
variables to the SP?
Myles
============================
Myles Wakeham
Director of Engineering
Tech Solutions US, Inc.
Scottsdale, Arizona USA
Phone (480) 451-7440
www.techsol.org