I use EF6.0 + Oracle 10g and code first approach.
In my migration there is such fragment of code:
Sql(@"
begin
insert into t_new1 (p1, p2)
select p1, p2 from t_old1;
insert into t_new2 (p1, p2)
select p1, p2 from t_old2;
...other DML operations.....
end;");
When I try to apply my migration using Update-Database
, I get error which does not give any hints about true nature of a problem.
It looks like
Devart.Data.Oracle.OracleException (0x80004005): ORA-06550: line 1, column 6:
PLS-00103: Encountered the symbol "" when expecting one of the following:begin case declare exit for goto if loop mod null pragma raise return select update while with
close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe
I suspect that it's not allowed to use Begin-End
blocks in DbMigration Sql
function. But I can not state it for sure and would like to hear some advices about this situation.
As a workaround it's possible to create stored procedure, execute it and then drop. However it seems not enough elegant.