Re: [SQL] create tables within functions

2003-06-13 Thread chester c young
--- Demidem Mohamed Amine <[EMAIL PROTECTED]> wrote: > hello, > > Can anyone help me create a function that creates a table: create function create_table( text ) returns integer as ' declare p_tab alias for $1; v_exec text; begin v_exec := ''create table '' || p_tab || ''( id integer )'';

Re: [SQL] create tables within functions

2003-06-13 Thread Stephan Szabo
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 i

[SQL] create tables within functions

2003-06-13 Thread Demidem Mohamed Amine
hello, Can anyone help me create a function that creates a table, in this way for example : 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 __