From: chester c young <chestercyoung@yahoo.com>
To: Demidem Mohamed Amine <demidem_amine@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: create tables within functions
Date: Fri, 13 Jun 2003 12:15:57 -0700 (PDT)
Message-ID: <20030613191557.35620.qmail@web12708.mail.yahoo.com> (raw)
In-Reply-To: <20030613150743.46827.qmail@web13603.mail.yahoo.com>
--- Demidem Mohamed Amine <demidem_amine@yahoo.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: chestercyoung@yahoo.com, demidem_amine@yahoo.com
Subject: Re: create tables within functions
In-Reply-To: <20030613191557.35620.qmail@web12708.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox