Re: SQL For smarties

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Graham Vickrage <graham(at)digitalplanit(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: SQL For smarties
Date: 2002-02-20 19:15:51
Message-ID: 20020220111526.A2906-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Wed, 20 Feb 2002, 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?

You'll probably need to generate the query string you want to run and
use execute.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jeff Eckermann 2002-02-20 19:20:06 Re: SQL For smarties
Previous Message Graham Vickrage 2002-02-20 18:55:51 Re: SQL For smarties