Reputation: 2416
Is is possible to select from execute block result? I want to perform some operation (sum etc..) from it.
select t1.*
from
( execute block
returns (
OUT_VALUE integer )
as
begin
...
suspend;
end ) t1
or
with
t1 as ( execute block ... )
select *
from t1
order by
t1.sort_column
Neither does not work. Anyone has an advice? Thanks!
Upvotes: 4
Views: 2496
Reputation: 128
You should create an independent stored procedure like
create procedure proc1
returns (
OUT_VALUE integer
) as
begin
...
suspend;
end
and then select on this proc
select sum(OUT_VALUE)
from proc1
Upvotes: 2