For each self-increment field in MySQL, you need to create a sequence and a trigger in Oracle.
Even if there are X self-increment fields in the same table, you need to create X sequence and x and trigger.
In practice, I have built 915 sequence and 915 trigger. Because MySQL has 915 self-increment segments.
The resulting statements are as follows:
Create sequence seq_e3_910_yugou_goodsmx_id increment by 1 start with 1
MinValue 1
Nomaxvalue
NoCache
Order
And
Create trigger trigger_e3_910_yugou_goodsmx_i before insert on "Yugou_goodsmx"
For each row
Begin
Select Seq_e3_910_yugou_goodsmx_id.nextval into:new. " ID "from Sys.dual
;
End
There are 915 such pairs of statements appearing.
But the runtime, error ora-24344:success with compilation error. (Warning: A trigger was created with a compilation error.) )
So I only run create sequence, no problem, ran hundreds of.
If you run create trigger again, the error will be reported as above.
But I put these create trigger, in the Navicat single run, will be successful.
Check the long time, just know the reason is: http://www.2cto.com/database/201304/205599.html
Because triggers need to be compiled first, each trigger needs to end with "/" before the next one can be executed.
The following are instead:
Create trigger trigger_e3_910_yugou_goodsmx_i before insert on "Yugou_goodsmx"
For each row
Begin
Select Seq_e3_910_yugou_goodsmx_id.nextval into:new. " ID "from Sys.dual
;
End
/
Just run through multiple create trigger at once.
About Oracle's sequence and trigger.