Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Dynamic SQL in Stored Procedure
Im using the Oracle Web Server, and I want to give the customer the ability choose a sort; in other words, affect the ORDER BY. Their request will be passed to a stored procedure, and Im wondering how (and if) I can change the SQL dynamically. I could do something like IF var1 = 'A' THEN
.. do some cursor stuff and issue a SELECT.. ORDER BY colA ELSE ORDER BY colB
var2 := 'emp_id';
else
var2 := 'city';
end if;
Followed by:
.. cursor stuff and a SELECT ...
ORDER BY var2
Or some such construct?
Any ideas greatly appreciated.
Mark_Aurit @ mail.northgrum.com
Received on Thu Jan 29 1998 - 00:00:00 CST
![]() |
![]() |