Re: How to convert "output deleted/inserted into" in MySQL to Postgres - Mailing list pgsql-general

From John R Pierce
Subject Re: How to convert "output deleted/inserted into" in MySQL to Postgres
Date
Msg-id 54E7A21B.3000807@hogranch.com
Whole thread Raw
In response to How to convert "output deleted/inserted into" in MySQL to Postgres  (Tong Michael <michaelbleedgreen@gmail.com>)
Responses Re: How to convert "output deleted/inserted into" in MySQL to Postgres
List 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 by date:

Previous
From: Tong Michael
Date:
Subject: How to convert "output deleted/inserted into" in MySQL to Postgres
Next
From: Michael_LT
Date:
Subject: Re: How to convert "output deleted/inserted into" in MySQL to Postgres