Re: create tables within functions

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: create tables within functions
Дата
Msg-id 20030613082154.M62271-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на create tables within functions  (Demidem Mohamed Amine <demidem_amine@yahoo.com>)
Список pgsql-sql
On Fri, 13 Jun 2003, Demidem Mohamed Amine wrote:

> hello,
>
> Can anyone help me create a function that creates a
> table, in this way for example :

See EXECUTE for a way to execute a query that you've built into
a string, for example, something like:

EXECUTE ''create table '' || $1 || '' (id integer, stuff text)'';

>
> create function create_table(text) returns integer as
> '
> begin
>   create table $1 (id integer, stuff text);
>   return 0;
> end;'
> language plpgsql;
>
> it does not work !!
>
> thnx
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>



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

Предыдущее
От: Demidem Mohamed Amine
Дата:
Сообщение: create tables within functions
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: question on rules