oracle sequence conversion
I understand that MySQL does NOT support sequences in the way that Oracle does.
I need to convert a "flat" file into separate tables. Given the following structure, how do I point one table to another?
section
class1
entry1
entry2
entryN...
class2
entryN+1
entryN+2
entryN+N...
classN...
Do I have to keep track of all the IDs (like the first set of entry should have a classID field = 1 and the second set a classID = 2) or is there some way for MySQL to do it for me.
In the Oracle import file I had:
create sequence sectionID;
create sequence classID;
create sequence entryID;
insert into section values (sectionID.nextval,'YY','XX','XYZ');
insert into class values (classID.nextval,sectionID.currval,0,'Aaa','Aaa','AAA','','','');
insert into entry values (entryID.nextval,classID.currval,'Entry1');
insert into entry values (entryID.nextval,classID.currval,'Entry2');
insert into entry values (entryID.nextval,classID.currval,'Entry3');
insert into class values (classID.nextval,sectionID.currval,0,'Abb','Abb','ABB','','','');
insert into entry values (entryID.nextval,classID.currval,'Entry4');
insert into entry values (entryID.nextval,classID.currval,'Entry5');
insert into entry values (entryID.nextval,classID.currval,'Entry5');
I also had foreign and primary keys defined to relate everything together.
Is there a way to mimic this way of working in MySQL?