Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Going from Oracle to Mysql

Going from Oracle to Mysql

From: cg <farmer_joe41_at_hotmail.com>
Date: Sun, 11 Aug 2002 22:54:45 +0200
Message-ID: <3d57a66d$0$395$d40e179e@nntp01.dk.telia.net>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US