pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Demidem Mohamed Amine <demidem_amine@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: create tables within functions
Date: Fri, 13 Jun 2003 08:22:42 -0700 (PDT)
Message-ID: <20030613082154.M62271-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <20030613150743.46827.qmail@web13603.mail.yahoo.com>

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
>




view thread (3+ messages)  latest in thread

Message-ID: <20030613082154.M62271-100000@megazone23.bigpanda.com>
Permalink:  ../20030613082154.M62271-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20030613082154.M62271-100000@megazone23.bigpanda.com

 · 

reply

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: sszabo@megazone23.bigpanda.com, demidem_amine@yahoo.com
  Subject: Re: create tables within functions
  In-Reply-To: <20030613082154.M62271-100000@megazone23.bigpanda.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