Search Postgresql Archives

Re: pgplsql, how to save row variable to a table row

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



2008/3/26, Raymond O'Donnell <rod@xxxxxx>:
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@xxxxxx
---------------------------------------------------------------


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux