插入数据前判断,防止重复数据。string Osql = @"INSERT INTO premapping
( buildinginfo_id, p_hocode,
p_mapcode, p_bunum, p_buname)
VALUES (:buildinginfo_id, :p_hocode,
:p_mapcode, :p_bunum, :p_buname)
where not exists ( select 1 from premapping where premapping.p_hocode=:p_hocode1)";这个SQL执行的时候,出错:ORA-00933: SQL command not properly ended。如何修改?
( buildinginfo_id, p_hocode,
p_mapcode, p_bunum, p_buname)
VALUES (:buildinginfo_id, :p_hocode,
:p_mapcode, :p_bunum, :p_buname)
where not exists ( select 1 from premapping where premapping.p_hocode=:p_hocode1)";这个SQL执行的时候,出错:ORA-00933: SQL command not properly ended。如何修改?
insert into ... select ... where ...,这个,可以有。