Re: Inserting Using RowType

Поиск
Список
Период
Сортировка
От John DeSoi
Тема Re: Inserting Using RowType
Дата
Msg-id 7FAB5452-B740-11D9-8B4D-000A95B03262@pgedit.com
обсуждение исходный текст
Ответ на Inserting Using RowType  (Greg Lindstrom <greg.lindstrom@novasyshealth.com>)
Список 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 по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: query like this???
Следующее
От: "Roland Giesler"
Дата:
Сообщение: Createlang error installing SQL-Ledger