Re: [PERFORM] Creating and updating table using function parameter reference

2008-02-15 Thread Linux Guru
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

Re: [PERFORM] Creating and updating table using function parameter reference

2008-02-14 Thread Linux Guru
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

Re: [PERFORM] Creating and updating table using function parameter reference

2008-02-14 Thread Albert Cervera Areny
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

[PERFORM] Creating and updating table using function parameter reference

2008-02-13 Thread Linux Guru
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

Re: [PERFORM] Creating and updating table using function parameter reference

2008-02-13 Thread Albert Cervera Areny
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: