how to get table's name from variable ? - Mailing list pgsql-sql

From maack
Subject how to get table's name from variable ?
Date
Msg-id Pine.SUN.3.91.990601041404.18281A-100000@aries.zrz.TU-Berlin.DE
Whole thread Raw
List pgsql-sql
Hi everybody,

I have a problem with getting a table's name from a 
variable.

example:

create function check_date(int4) returns date as '
declare 
my_date date ;
my_tablename text ;
begin
select tname into my_tablename from tw where id = $1 ;
select max(idate) into my_date from my_tablename where id = $1 ; 
return(my_date);
end;
' language 'plpgsql';

in the second select-query 'my_tablename' should give the (result-) 
tablename 
from the first query. How can this be done with postgres?

a friend has shown me the following  with oracle: 
select .... from &var ; 

is this possible with postgres too?

greetings+thanks,
Thomas


pgsql-sql by date:

Previous
From: "Pham, Thinh"
Date:
Subject: Column name's length
Next
From: Bruce Momjian
Date:
Subject: Re: [SQL] Column name's length