Received: from web20807.mail.yahoo.com (web20807.mail.yahoo.com [216.136.226.196]) by postgresql.org (8.11.6/8.11.4) with SMTP id g1KJK7F91060 for ; Wed, 20 Feb 2002 14:20:07 -0500 (EST) (envelope-from jeff_eckermann@yahoo.com) Message-ID: <20020220192006.50990.qmail@web20807.mail.yahoo.com> Received: from [68.14.103.240] by web20807.mail.yahoo.com via HTTP; Wed, 20 Feb 2002 11:20:06 PST Date: Wed, 20 Feb 2002 11:20:06 -0800 (PST) From: Jeff Eckermann Subject: Re: SQL For smarties To: Graham Vickrage , pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200202/257 X-Sequence-Number: 6681 Try: execute ''create table '' || $1 || ''_tree (....)''; (That's doubled single quotes) --- Graham Vickrage wrote: > I am trying to create tables from within a funtion > i.e. > > create function _tree_create(text) retuns int as ' > begin; > create table $1_tree (....); > return 1; > end; > ... > > select _tree_create('item'); > > An error message refering to $1 gets thrown up. Is > this not possible to do > or is there another way of doing it? > > Thanks in advance. > > Graham > > > > ---------------------------(end of > broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html __________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com