两种方法:
1:先创建临时表,数据commit或者rollback时数据自动清空
create GLOBAL TEMPORARY table tmp_table(tmp_stock VARCHAR2(10) PRIMARY KEY ,tmp_date VARCHAR2(10), tmp_value number )
2.insert info tmp_table (tmp_stock, tmp_date , tmp_value) values(:1,:2,:3)
3"update 修改表 as x, 临时表 as t set x.nlp_name_semantics_v3=t.nlp_name_semantics_v3 where x.id=t.id;"
二:
merge into
UF_COMMON_FAC_DATA_G a1 using
(
select 'a000.SZ' stock, 122 value ,'20180101' date_data from dual union
select 'a001.SZ' stock, 122 value ,'20180102' date_data from dual
) A2 ON
(a1.date_data=A2.date_data
and
a1.stock_code = a2.stock)
WHEN MATCHED THEN UPDATE SET A1.col1=A2.value
WHEN NOT MATCHED THEN INSERT
(date_data,stock_code,col1) VALUES (
A2.date_data,
A2.stock,
A2.value)