To pass schemaname as a function parameter

From: Kalai R <softlinne(dot)kv(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: To pass schemaname as a function parameter
Date: 2009-09-03 11:28:13
Message-ID: 762e576c0909030428v255b628bkcd089fc6874c137f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I wrote a function in plpgsql, to dispaly the student list.

In a Database all schemas contains studentlist table. so I wrote the
function with schemaname as a parameter(text data type). My code is
like

CREATE FUNCTION disp_fn(schemaname text) AS $$
BEGIN
SELECT * FROM schemaname.studentlist;
END;
$$ LANGUAGE plpgsql;

In the above function schemaname varaible does not taken.

Is there any way to pass schemaname as argument? Any idea would be
much appreciated.

Thanks in Advance.

Regards

Softlinne

Responses

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2009-09-03 11:37:05 Re: To pass schemaname as a function parameter
Previous Message Wellmann, Harald 2009-09-03 08:37:46 Re: Subselect problem