Re: create tables within functions

From: chester c young <chestercyoung(at)yahoo(dot)com>
To: Demidem Mohamed Amine <demidem_amine(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: create tables within functions
Date: 2003-06-13 19:15:57
Message-ID: 20030613191557.35620.qmail@web12708.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

--- Demidem Mohamed Amine <demidem_amine(at)yahoo(dot)com> wrote:
> hello,
>
> Can anyone help me create a function that creates a table:

create function create_table( text ) returns integer as '
declare
p_tab alias for $1;
v_exec text;
begin
v_exec := ''create table '' || p_tab || ''( id integer )'';
execute v_exec;
end;
' language 'plpgsql';

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Craig Jensen 2003-06-13 19:45:48 rpm scripts
Previous Message Jan Wieck 2003-06-13 16:30:27 Re: question on rules