Inserting Using RowType

From: Greg Lindstrom <greg(dot)lindstrom(at)novasyshealth(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Inserting Using RowType
Date: 2005-04-27 16:19:04
Message-ID: 426FBB78.2090607@novasyshealth.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Is it possible to INSERT data into a table using a rowtype data type? I
have a long (~5000 byte, 300 field) record *which I did not design* that
needs to be loaded into a table. In my plsql function I accept a line
from a data file. I have declared a ib837 variable to be of
my_table%rowtype and go about assigning each field to the ib837 record
using substr on the input field (yes, that's 329 rows, sigh). 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).

Thanks for your help,
--greg

--
Greg Lindstrom 501 975.4859 (office)
Senior Programmer 501 219-4455 (fax)
NovaSys Health greg(dot)lindstrom(at)novasyshealth(dot)com
Little Rock, Arkansas

"We are the music makers, and we are the dreamers of dreams." W.W.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2005-04-27 16:43:40 Re: query like this???
Previous Message Akbar 2005-04-27 16:12:48 query like this???