#!/bin/sh 
sqlplus -s user/[email protected] <<END 
SET serveroutput ON; 
BEGIN 
MERGE INTO TESTA t USING TESTA_TEMP s ON 
(
    t.WAFER_ID = s.WAFER_ID 
) 
WHEN MATCHED THEN 
    UPDATE 
    SET 
    t.bin1 = s.bin1 WHEN NOT MATCHED THEN 
    INSERT 
    (
     id, 
     bin1, 
     wafer_id 
    ) 
    VALUES 
    (
     s.id, 
     s.bin1, 
     s.wafer_id 
    ); 
END; 
/
END 

 

posted on 2022-08-11 08:48  root-123  阅读(88)  评论(0编辑  收藏  举报