Oracle 的「批次 (batch) 更新」、「批次新增」、「批次删除」语法

Oracle 的「批次 (batch) 更新」、「批次新增」、「批次删除」语法

Oracle 仍可如 SQL Server、Sybase 数据库,用「分号 (;)」隔离多个 SQL statement,只是 Oracle 前后要再加上 begin、end 关键词,例如:

string strSql = "begin insert into table01(id,name) values(99,'test'); insert into table01(id,name) values(99,'test'); end;";
string strSql = "begin update table01 set name='test2' where id=99; update table01 set name='test2' where id=99; end;";
string strSql = "begin delete from table01 where id=99; delete from table01 where id=19; end;";

因 Oracle 语法较严谨,不能直接在 SQL 语句中,出现「;」等特殊符号。

posted on 2010-08-25 14:37  kafony  阅读(966)  评论(0编辑  收藏  举报

导航