X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 9255E30EB44 for ; Fri, 13 Jun 2003 19:16:08 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 81996-09 for ; Fri, 13 Jun 2003 16:15:58 -0300 (ADT) Received: from web12708.mail.yahoo.com (web12708.mail.yahoo.com [216.136.173.245]) by svr1.postgresql.org (Postfix) with SMTP id 8C70C30EA1B for ; Fri, 13 Jun 2003 16:15:57 -0300 (ADT) Message-ID: <20030613191557.35620.qmail@web12708.mail.yahoo.com> Received: from [63.230.97.206] by web12708.mail.yahoo.com via HTTP; Fri, 13 Jun 2003 12:15:57 PDT Date: Fri, 13 Jun 2003 12:15:57 -0700 (PDT) From: chester c young Subject: Re: create tables within functions To: Demidem Mohamed Amine Cc: pgsql-sql@postgresql.org In-Reply-To: <20030613150743.46827.qmail@web13603.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200306/127 X-Sequence-Number: 13885 --- Demidem Mohamed Amine 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