newbie pl/pgsql question

Поиск
Список
Период
Сортировка
От Marco Colombo
Тема newbie pl/pgsql question
Дата
Msg-id Pine.LNX.4.44.0309261427000.25502-100000@Megathlon.ESI
обсуждение исходный текст
Список pgsql-general
Is there a way to INSERT / UPDATE a row using the data stored in
a single %ROWTYPE variable?

Something along the line:

DECLARE
    onerow    table1%ROWTYPE;
BEGIN
    -- get the data
    SELECT INTO onerow <some expression>;

    -- insert them into the table
    INSERT INTO table1 VALUES onerow; -- this is not valid of course
END;

I know that:

    INSERT INTO table1 VALUES (
        onerow.col1,
        onerow.col2,
        ...
        onerow.col100);

will work, but i wonder if there's a smarter way.

Same for UPDATE (that one I understand is trickier).

TIA,
.TM.
--
      ____/  ____/   /
     /      /       /            Marco Colombo
    ___/  ___  /   /              Technical Manager
   /          /   /             ESI s.r.l.
 _____/ _____/  _/               Colombo@ESI.it


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

Предыдущее
От: Eugene Strulyov
Дата:
Сообщение: transaction timeout
Следующее
От: bill-bell@bill-bell.hamilton.on.ca (Bill Bell)
Дата:
Сообщение: Hesitate to write this: can't get at postgres.org