List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:October 19 2004 11:23am
Subject:Re: Sequences and Synomyms
View as plain text  
Hello,

>     I am new to mysql. I want to create sequences in mysql 4.0 which
> should be equivalent to oracle sequences. I gone through the mysql
> manual, Auto_Increment(), C API mysql_insert_id() and LAST_INSERT_ID()
> are there for sequences. Last_insert_id() gives the last value.
> I want actual migration to mysql for the following oracle statement
> create sequence msdba.ms_sequence maxvalue 100000000 cycle order;
>
> Could you please suggest how to do it.

MySQL doesn't support sequences. It supports auto-inc fields only.

> And also I want to create synonym in mysql for the following oracle
> statement
>
> create synonym msuser.ms_sequence for msdba.msuser_sequence;

Not supported in MySQL. When using MyISAM, you can probably
create a symbolic link of some sorts (in the file system, not MySQL
itself), but nothing like a real synonym.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com

Thread
Sequences and Synomymslakshmi.narasimharao19 Oct
  • Re: Sequences and SynomymsMartijn Tonies19 Oct