Re: SQL For smarties

From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: Graham Vickrage <graham(at)digitalplanit(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: SQL For smarties
Date: 2002-02-20 19:20:06
Message-ID: 20020220192006.50990.qmail@web20807.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Try:

execute ''create table '' || $1 || ''_tree (....)'';
(That's doubled single quotes)

--- Graham Vickrage <graham(at)digitalplanit(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-02-20 20:16:59 Re: SQL For smarties
Previous Message Stephan Szabo 2002-02-20 19:15:51 Re: SQL For smarties