Subject Is there possibility to return dynamic number of columns from EXECUTE BLOCK /SP?
Author un_spoken
Hello.

I am pretty sure that is not possible. I've read all info I could get on the web and it clearly says that output variables /columns must be defined for stored procedure or execute block. But maybe I am wrong?

Maybe it is somehow possible to do something like this?

SET TERM ^ ;
EXECUTE BLOCK
AS
DECLARE S varchar(255);
BEGIN
S = 'SELECT ' || DYNAMIC_COL1 || ' , ' || DYNAMIC_COL2 || ' FROM MY_TABLE';
EXECUTE STATEMENT S;
END^

The thing is that I am trying to build a query that will return a different number of columns (with varying names) basing on the input parameters.

But I guess that is not possible?:(

Thanks for your time.