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 14FDD30EC03 for ; Fri, 13 Jun 2003 15:22:54 +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 44309-09 for ; Fri, 13 Jun 2003 12:22:43 -0300 (ADT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by svr1.postgresql.org (Postfix) with ESMTP id A9C5E30EBD1 for ; Fri, 13 Jun 2003 12:22:43 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 94794D624; Fri, 13 Jun 2003 08:22:42 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 8A2B95C0D; Fri, 13 Jun 2003 08:22:42 -0700 (PDT) Date: Fri, 13 Jun 2003 08:22:42 -0700 (PDT) From: Stephan Szabo To: Demidem Mohamed Amine Cc: Subject: Re: create tables within functions In-Reply-To: <20030613150743.46827.qmail@web13603.mail.yahoo.com> Message-ID: <20030613082154.M62271-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200306/125 X-Sequence-Number: 13883 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 >