SQLServer的场合,用";"分割SQL语句即可正常执行。
Oracle的场合,会报ORA-00911错误。Oracle中需要加上begin end才正确。
Dim Sql As String = ""
Sql = Sql & " BEGIN "
Sql = Sql & vbCrLf
Sql = Sql & " insert into tableA (col1,col2,col3) values ('a','a','a');"
Sql = Sql & vbCrLf
Sql = Sql & " insert into tableA (col1,col2,col3) values ('b','b','b');"
Sql = Sql & vbCrLf
Sql = Sql & " END; " Dim comd As New OleDbCommand(Sql, DbConn)
comd.ExecuteNonQuery()