From: Jeff Eckermann <jeff_eckermann@yahoo.com>
To: Graham Vickrage <graham@digitalplanit.com>
To: pgsql-sql@postgresql.org
Subject: Re: SQL For smarties
Date: Wed, 20 Feb 2002 11:20:06 -0800 (PST)
Message-ID: <20020220192006.50990.qmail@web20807.mail.yahoo.com> (raw)
In-Reply-To: <NDBBJABDILOPAOOMFJHOGEAMDEAA.graham@digitalplanit.com>
Try:
execute ''create table '' || $1 || ''_tree (....)'';
(That's doubled single quotes)
--- Graham Vickrage <graham@digitalplanit.com> 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
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: jeff_eckermann@yahoo.com, graham@digitalplanit.com
Subject: Re: SQL For smarties
In-Reply-To: <20020220192006.50990.qmail@web20807.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