Re: How to convert "output deleted/inserted into" in MySQL to Postgres

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: How to convert "output deleted/inserted into" in MySQL to Postgres
Дата
Msg-id 54E7A21B.3000807@hogranch.com
обсуждение исходный текст
Ответ на How to convert "output deleted/inserted into" in MySQL to Postgres  (Tong Michael <michaelbleedgreen@gmail.com>)
Ответы Re: How to convert "output deleted/inserted into" in MySQL to Postgres  (Michael_LT <michaelbleedgreen@gmail.com>)
Список pgsql-general
On 2/20/2015 12:59 PM, Tong Michael wrote:
I think it tried to update a couple of columns in table user and insert values in other 3 columns into another table ReconDeleted at the same time. I have issues converting "OUTPUT INTO" and "deleted" items, with my limited knowledge about Postgres, I don't think we have those in pg. Can someone tell me how to convert it? Thanks. 

no idea what 'deleted' means, but, assuming this in is plpgsql, use UPDATE .... RETURNING ...INTO rather than OUTPUT INTO,

http://www.postgresql.org/docs/current/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW

now, if this in a trigger function, you can refer to OLD. and NEW.



-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast

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

Предыдущее
От: Tong Michael
Дата:
Сообщение: How to convert "output deleted/inserted into" in MySQL to Postgres
Следующее
От: Michael_LT
Дата:
Сообщение: Re: How to convert "output deleted/inserted into" in MySQL to Postgres