Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Dynamic Order By in embedded sql

Author  Topic 

patty
Starting Member

3 Posts

Posted - 2001-04-06 : 14:21:43
I am trying to dynamically use the ORDER BY clause depending on the radio button selected by the user. (embedded SQL)

string ls_mod
ls_mod = "dbo.DHTFOSCH.CREW" (or whatever depending on the radio button selection)
CONNECT USING istr_report.database;
SetPointer(HourGlass!)
DECLARE lcur_daily_emergency CURSOR FOR
SELECT yada
FROM yada
WHERE yada
ORDER BY :ls_mod
USING istr_report.database;

ls_mod does contain the correct value, but the order by doesn't work. When I hard code the value, it works fine. Any ideas? Thanks.



   

- Advertisement -