Patrick Fiche wrote:
> I'm not sure I really understood what you want...
>
> Here is perhaps what you need...
>
>
> CREATE TABLE t1
> (
> col1 text
> );
>
> create or replace function foo(text) returns text as '
> DECLARE
> colname ALIAS FOR $1;
> sqlquery text;
> result text;
> BEGIN
> sqlquery := ''INSERT INTO t1 (col1 ) SELECT '' || colname || '' from
> toto'';
> EXECUTE( sqlquery );
>
> SELECT INTO result col1 FROM t1;
> DELETE FROM t1;
> RETURN result;
> END;
> ' language 'plpgsql';
Thank You Patrick. I consider Your solution as a workaround as it
uses a temporary table.
As far as I know, PL/Tcl directly supports dynamic table names - but
now I have difficulties to specify a literal value which should not
be treated as column name but as varchar-value.
Please see my other post for details.
Regards,
Hans