I am using Sybase IQ Server 14.3 and I have declare a variable in a store procedure.
For example :
declare @stmt varchar(100)
select @stmt = @stmt +' select * from tb1'
at the end of the store procedure, I want to execute this variable, i.e, I want to do the query 'select * from tb1', but of course I can't just type select * from tb1 at the end coz the query must generated dynamic. I know that in SQLServer, I can use Exec (@stmt) to do that, but it seems it doesn't work in IQ.
What should I do? Is it possible for me to do that in IQ?
Thanks in advance~