thanks, i posted in this listed because it was related to my previous query.
Anyway, I am able to achieve, with the help in this mailing list, what I
wanted but is there any way to further optimize this.
Thanks
CREATE OR REPLACE FUNCTION test ( t1 text ) RETURNS numeric AS $$
declare cmd1
I still cannot pass tablename, what is wrong?
Is this the right way?
CREATE OR REPLACE FUNCTION test ( t1 text,t2 text ) RETURNS numeric AS $$
declare temp1 text;
declare temp2 text;
declare cmd text;
declare t2row RECORD;
begin
temp1=t1;
temp2=t2;
cmd='select product, (case when
You need the string concatenation operator ||. Take a look at
http://www.postgresql.org/docs/8.3/static/functions-string.html
By the way, this is off-topic in this list please, post general
non-performance questions to pgsql-general.
A Dijous 14 Febrer 2008 13:35, Linux Guru va escriure:
I
I want to create and update two tables in a function such as below, but
using parameters as tablename is not allowed and gives an error. Is there
any way I could achieve this?
CREATE OR REPLACE FUNCTION test ( t1 text,t2 text ) RETURNS numeric AS $$
declare temp1 text;
declare temp2 text;
begin
A Dimecres 13 Febrer 2008 15:25, Linux Guru va escriure:
I want to create and update two tables in a function such as below, but
using parameters as tablename is not allowed and gives an error. Is there
any way I could achieve this?
You're looking for EXECUTE: