[GENERAL] how to do merge in postgres ("with upsert as" not supported)

2015-02-26 Thread Tong Michael
hey, guys, I came across a merge statement when I'm trying to convert stored procedures from Mysql to Postgres: merge into db.ChargePeriod d using ( select ba.ClientID , ba.BillingAccountID , bs.BillingScheduleID , @CodeWithholdD as WithholdTypeID from

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

2015-02-20 Thread Tong Michael
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 , Upda