* Amit jain ([EMAIL PROTECTED]) wrote: > I am currently migrating database from ORACLE to postgresql but i am stucked > up at one point while creating procedures. > There is a query which has used oracle MERGE condition so how can i change > this query as per posgresql. kindly suggest me its very urgent.
If you're talking about what I think you're talking about, then basically you need to break up the MERGE into seperate insert/update steps. You just have to write the queries such that if the record doesn't exist, it gets inserted, and if it does exist, then it gets updated. MERGE just allows you to do this in a nicer, somewhat more efficient, way. If you've got alot of transactions happening around the same time with the table in question then you may also have to write your logic to be able to handle a rollback and to try again. Enjoy, Stephen
signature.asc
Description: Digital signature