Re: [SQL] Create table in functions

2000-08-24 Thread hlefebvre
Andreas Tille wrote: > What does this mean? The ERROR is caused by the Create Table statement > (when I removed it from my complex function it worked well). > So why doesn't this work and what copy function fails here?? Maybe you can create your table using a select into statement : something l

RE: [SQL] Create table in functions

2000-08-23 Thread Hiroshi Inoue
> -Original Message- > From: Tom Lane > > "Hiroshi Inoue" <[EMAIL PROTECTED]> writes: > > Hmm,Andreas's original function seems to contain other statements. > > If the function contains DML statements for the table Temp_Num_Table, > > it wouldn't work properly. i.e 1st call would work but

Re: [SQL] Create table in functions

2000-08-23 Thread Tom Lane
"Hiroshi Inoue" <[EMAIL PROTECTED]> writes: > Hmm,Andreas's original function seems to contain other statements. > If the function contains DML statements for the table Temp_Num_Table, > it wouldn't work properly. i.e 1st call would work but 2nd call woudn't. Are you thinking about plpgsql's cach

RE: [SQL] Create table in functions

2000-08-23 Thread Hiroshi Inoue
> -Original Message- > From: Tom Lane > > Andreas Tille <[EMAIL PROTECTED]> writes: > > web=# create function pHelpTable( ) > > web-# returns int > > web-# As ' > > web'# Begin > > web'# Create Table Temp_NumTable ( Num int ) ; > > web'# > > web'# return 17 ; > > we

Re: [SQL] Create table in functions

2000-08-23 Thread Jie Liang
Hi, there, I don't think that you can use DDL in PL/pgSQL, normally say , you can only use DML in PL/pgSQL. i.e. you can use select into,update,delete,insert ... , but you cannot use create, alter, grant ... Andreas Tille wrote: > Hello, > > I striped down my function up to a strange thing: >

Re: [SQL] Create table in functions

2000-08-23 Thread Tom Lane
Andreas Tille <[EMAIL PROTECTED]> writes: > web=# create function pHelpTable( ) > web-# returns int > web-# As ' > web'# Begin > web'# Create Table Temp_NumTable ( Num int ) ; > web'# > web'# return 17 ; > web'# End; ' > web-# language 'plpgsql' ; > CREATE The majori

[SQL] Create table in functions

2000-08-23 Thread Andreas Tille
Hello, I striped down my function up to a strange thing: web=# create function pHelpTable( ) web-# returns int web-# As ' web'# Begin web'# Create Table Temp_NumTable ( Num int ) ; web'# web'# return 17 ; web'# End; ' web-# language 'plpgsql' ; CREATE web=# web=# s