INSERT INTO AA_TempData (VoucherCode, CustomerCode, nVoucherCode nCustomerCode) values (' and ', 'and', 'and', '41)
ELSE UPDATE AA_TempData SET VoucherCode='41, CustomerCode=' 41 ', nVoucherCode='41', nCustomerCode '41 WHERE id=25
Above is no problem of SQL in essentially, if there id=25 and then perform an update, if there is no insert
But now change to the Oracle, grammar is different, is not, ask the great spirit
CodePudding user response:
1, you can continue to use the select count (*) statements, like this:Select count (*) into v_cnt the from...
If v_cnt=0 then
Insert into...
The else
The update
End the if;
2, see the oracle merge into statements, very strong,
CodePudding user response: