Creating tables from within functions

Поиск
Список
Период
Сортировка
От Seethalakshmi VB
Тема Creating tables from within functions
Дата
Msg-id MCBBKKFNMOLJEPPNKICGCEABCAAA.seethalakshmi.vb@majoris.com
обсуждение исходный текст
Ответы Re: Creating tables from within functions  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-sql
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.  For example, consider:
CREATE FUNCTION _testcreate () RETURNS text AS 'BEGIN    CREATE TABLE switch_table2 (switch_id varchar(32),
selection_name varchar(100));end;' language 'plpgsql';

What is wrong with this?  What type should be returned?  Or perhaps it is
simply not possible to create a table from within a function?

Please give me the reply soon as possible
Thanks!


В списке pgsql-sql по дате отправления:

Предыдущее
От: Horst Herb
Дата:
Сообщение: Re: SQL to list databases?
Следующее
От: Oliver Vecernik
Дата:
Сообщение: Re: CSV import