Re: [SQL] Creating tables from within functions

2003-02-01 Thread Sondaar Roelof
Hello, Try this: CREATE FUNCTION _testcreate () RETURNS text AS ' BEGIN CREATE TABLE switch_table2 (switch_id varchar(32), selection_name varchar(100)); RETURN ''true''; END; ' language 'plpgsql'; SELECT _testcreate(); Result: snlsor=# SELECT _testcreate(); _testcreate -

Re: [SQL] Creating tables from within functions

2003-01-29 Thread Stephan Szabo
On Fri, 24 Jan 2003, Seethalakshmi VB wrote: > Is it possible to issue a CREATE TABLE statement from inside of a PostgreSQL > function? If not, then how about from within a PL/pgSQL function? I have > tried a lot of different permutations but can't seem to get it to compile > and/or run cleanly