Hi,
I have a table with function names and some other flags where to run them. Sth like this table called PROCESS
then I have function that should execute selected functions sth like
This is pretty much how I would handle this situation in Oracle, but Postgre does not allow
execute 'perform....'
Any suggestion how to resolve this issue?
Karel
I have a table with function names and some other flags where to run them. Sth like this table called PROCESS
Code:
name run_daily run_monthly func1 Y N func2 Y Y func3 N Y ...
Code:
create or replace function execute_process() returns void as
$$
declare
c_process refcursor;
r_process dwh_loader.process%ROWTYPE;
v_stmt varchar(200);
begin
OPEN c_process FOR SELECT *
FROM process
WHERE run_daily = 'Y';
LOOP
fetch c_process into r_process;
--
IF NOT FOUND THEN
EXIT; -- exit loop
END IF;
v_stmt := 'perform '|| r_process.name ||';';
--
execute v_stmt;
END LOOP;
--
return;
end;
$$language plpgsql;
execute 'perform....'
Any suggestion how to resolve this issue?
Karel
Comment