Re: pgplsql, how to save row variable to a table row - Mailing list pgsql-general

From josep porres
Subject Re: pgplsql, how to save row variable to a table row
Date
Msg-id d2d532610803260514h3393bac9ja8c9d44184ff0c@mail.gmail.com
Whole thread Raw
In response to Re: pgplsql, how to save row variable to a table row  (Raymond O'Donnell <rod@iol.ie>)
Responses 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  (Sam Mason <sam@samason.me.uk>)
List 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



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 by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: pgplsql, how to save row variable to a table row
Next
From: Sam Mason
Date:
Subject: Re: select any table