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

Поиск
Список
Период
Сортировка
От Tong Michael
Тема How to convert "output deleted/inserted into" in MySQL to Postgres
Дата
Msg-id CAHVHtZ-hD8kdTVJJBQgK7g4x6fkgycAe8Bv7Ajj4DUP1U3HRBQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to convert "output deleted/inserted into" in MySQL to Postgres  (John R Pierce <pierce@hogranch.com>)
Re: How to convert "output deleted/inserted into" in MySQL to Postgres  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-general

hey guys, I'm kinda new to Postgres and I'm learning it now. I have work to convert some stored procedures in MySQL to Postgres and I came across an issue here that I can't solve: 

update  db.user 
             set Deleted        = 1 
            , UpdateTerminal = @UpdateTerminal 
             , UpdateUser     = @UpdateUser 
             , UpdateDate     = @UpdateDate 
        output deleted.CreditTypeID 
             , deleted.CreditID 
             , deleted.Amount 
          into @ReconDeleted 
         where Deleted = 0 
           and ClientID = @ClientID; 

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. 

PS: it's my first time using this form, nice to meet you guys:)


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

Предыдущее
От: Melvin Davidson
Дата:
Сообщение: Re: PL/PgSQL and pg_temp pseudo-schema
Следующее
От: John R Pierce
Дата:
Сообщение: Re: How to convert "output deleted/inserted into" in MySQL to Postgres