You can do this with the exec keyword; see example below. But, in general I would not recommend doing this because you lose the primary benefit of creating the stored procedure which is the precompilation of the query plan.
create procedure exec_sql
To test this proc, try executing:
exec exec_sql "select getdate()"
Originally Posted by thomasmsho
I'm a new user for Sybase
Is there anyone whether there is any similar oracle feature in Sybase:-
procedure exec_sql(intext varchar2)
EXECUTE IMMEDIATE intext;
Then I can call this sp by:-
execute exec_sql('delete from student');
So that I can create a procedure which can execute any sql statement passed in.