Re: Inserting Using RowType - Mailing list pgsql-novice

From John DeSoi
Subject Re: Inserting Using RowType
Date
Msg-id 7FAB5452-B740-11D9-8B4D-000A95B03262@pgedit.com
Whole thread Raw
In response to Inserting Using RowType  (Greg Lindstrom <greg.lindstrom@novasyshealth.com>)
List pgsql-novice
On Apr 27, 2005, at 12:19 PM, Greg Lindstrom wrote:

> What I would then like to do is:
>
> INSERT INTO my_table ib837;
>
> Where the ib837 is of type my_table%rowtype.  Is this possible?  Is
> there another -- easier/better -- way to load these record into the
> table?  The input record is fixed-width, though it does not contain
> all of the fields in the table (I add a timestamp and an id column).
>


ib837 does have all the fields of my_table if you defined it as
my_table%rowtype (even if you did not assign them all). So you could
use this:

INSERT INTO my_table VALUES (ib837.*);


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


pgsql-novice by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: query like this???
Next
From: "Roland Giesler"
Date:
Subject: Createlang error installing SQL-Ledger