Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Going from Oracle to Mysql
cg wrote:
> 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.
What is going on here? Several questions about MySQL in the last few days. Which part of the fact that the name of these usenet groups is comp.databases.ORACLE is escaping you folks?
Daniel Morgan Received on Mon Aug 12 2002 - 10:26:27 CDT
![]() |
![]() |