Re: Inserting Using RowType

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Inserting Using RowType
Дата
Msg-id 20050427173416.GA58398@winnie.fuhr.org
обсуждение исходный текст
Ответ на Inserting Using RowType  (Greg Lindstrom <greg.lindstrom@novasyshealth.com>)
Ответы Re: Inserting Using RowType  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
On Wed, Apr 27, 2005 at 11:19:04AM -0500, Greg Lindstrom wrote:
>
> 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;

PostgreSQL 8.0 has better support for composite types than previous
versions.  For example, the following works for me in 8.0.2:

INSERT INTO my_table VALUES (ib837.*);

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Roland Giesler"
Дата:
Сообщение: Createlang error installing SQL-Ledger
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Inserting Using RowType