Re: pgplsql, how to save row variable to a table row
От | josep porres |
---|---|
Тема | Re: pgplsql, how to save row variable to a table row |
Дата | |
Msg-id | d2d532610803260514h3393bac9ja8c9d44184ff0c@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: pgplsql, how to save row variable to a table row (Raymond O'Donnell <rod@iol.ie>) |
Ответы |
Re: pgplsql, how to save row variable to a table row
Re: pgplsql, how to save row variable to a table row |
Список | pgsql-general |
I've tried:
EXECUTE 'INSERT INTO F2_TEMPFAC SELECT * FROM row_tempf';
but I've got not surprisingly:
ERROR: relation "row_tempf" does not exist
Estado SQL:42P01
Contexto:SQL statement "INSERT INTO F2_TEMPFAC SELECT * FROM row_tempf"
PL/pgSQL function "f2_facturar" line 437 at EXECUTE statement
I'm going to try your suggestion, however it's a bit annoying because this table has a lot of fields.
maybe i'm lazy to write all of them :P ...
well... hands on it!!!
thx
Josep
EXECUTE 'INSERT INTO F2_TEMPFAC SELECT * FROM row_tempf';
but I've got not surprisingly:
ERROR: relation "row_tempf" does not exist
Estado SQL:42P01
Contexto:SQL statement "INSERT INTO F2_TEMPFAC SELECT * FROM row_tempf"
PL/pgSQL function "f2_facturar" line 437 at EXECUTE statement
I'm going to try your suggestion, however it's a bit annoying because this table has a lot of fields.
maybe i'm lazy to write all of them :P ...
well... hands on it!!!
thx
Josep
2008/3/26, Raymond O'Donnell <rod@iol.ie>:
On 26/03/2008 11:59, josep porres wrote:
> row_tempf.field1 := value1;
> row_tempf.field2 := value3;
> ...
> row_tempf.fieldN := valueN;
>
> -- NOW INSERT row_tempf in the associated table
> -- ???
Easy! -
insert into <tablename> ( <column> ... )
values (row_tempf.field1, row_tempf.field2, ... );
:-)
Ray.
---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------
В списке pgsql-general по дате отправления: