thedumbkid
Programmer
I have another question
It's about dynamic query...
Is it possible to use a dynamic query in pl/pgsql function to update a variable?
I am trying to do something like the following:
create function myfunction(varchar) returns int4 as '
declare
v_table_name alias for $1;
v_num int4;
begin
execute ''select into v_num count(*) from '' || v_table_name;
end;' language 'plpgsql';
It's about dynamic query...
Is it possible to use a dynamic query in pl/pgsql function to update a variable?
I am trying to do something like the following:
create function myfunction(varchar) returns int4 as '
declare
v_table_name alias for $1;
v_num int4;
begin
execute ''select into v_num count(*) from '' || v_table_name;
end;' language 'plpgsql';