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

From: "josep porres" <jmporres(at)gmail(dot)com>
To: rod(at)iol(dot)ie
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pgplsql, how to save row variable to a table row
Date: 2008-03-26 12:14:07
Message-ID: d2d532610803260514h3393bac9ja8c9d44184ff0c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)iol(dot)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(at)iol(dot)ie
> ---------------------------------------------------------------
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2008-03-26 12:14:15 Re: select any table
Previous Message Raymond O'Donnell 2008-03-26 12:08:25 Re: pgplsql, how to save row variable to a table row