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)
 embedded SQL

Author  Topic 

patty
Starting Member

3 Posts

Posted - 2001-04-06 : 16:43:53
I am trying to dynamically use the ORDER BY clause depending on the radio button selected by the user. (embedded SQL)
The value of ls_mod changes depending on which radio button the user selects at run time. EX:
string ls_mod
if rb_region.checked = true then
ls_mod = "dbo.DHTFOCMN.DISTRICT"
end if
if rb_opctr.checked = true then
ls_mod = "dbo.DHTFOCMN.DISTRICT"
end if
if rb_gwa.checked = true then
ls_mod = "dbo.DHTFOCMN.SERVICE_AREA"
end if
if rb_crew.checked = true then
ls_mod = "dbo.DHTFOSCH.CREW"
end if

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 -