Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Going from Oracle to Mysql
In mysql I have created the following table:
CREATE TABLE Emp(
EmpNr INTEGER NOT NULL AUTO_INCREMENT,
Name varchar(30) NOT NULL,
Adr varchar(30) NOT NULL,
zip INTEGER NOT NULL,
city varchar(30) NOT NULL,
phone varchar(20) NOT NULL,
Email varchar(30),
Password varchar(40) NOT NULL,
PRIMARY KEY(EmpNr));
The first element, EmpNr, has an auto_increment variable attached to it.
Now, in Oracle, I would use a a statement like the following in order to insert into a table with a sequence attached to it:
insert into Emp values (Unik.nextval,?,?,?,?,?,?,?)
(used for a preparedStatement in the database)
What would the corresponding query look like in mysql??
Also I would like to know what the following query looks like in mysql:
select AddedEmp.currval from Emp
(when the sequence in Oracle looks like
create sequence AddedEmp increment by 1;)
??
Any help is very much appreciated!
ps please do also send to my email address in the response. Received on Sun Aug 11 2002 - 15:54:45 CDT
![]() |
![]() |