File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
how to create sequence in mysql
Joined: Apr 17, 2007
Apr 17, 2007 00:26:00
please send me the syntax for creating the sequence in mysql and how that sequence be linked to different fields of different tables.
Joined: Apr 07, 2007
Apr 17, 2007 11:46:00
MySQL doesn't use sequences. You will use AUTO_INCREMENT fields. The following CREATE TABLE statement shows an example:
CREATE TABLE person (
PERSON_ID int(10) NOT NULL auto_increment,
FIRST_NAME varchar(50) default NULL,
MIDDLE_NAME varchar(50) default NULL,
LAST_NAME varchar(50) default NULL,
PRIMARY KEY (PERSON_ID)
Then when you insert into the table just don't specify a value for the PERSON_ID:
INSERT INTO person (first_name, last_name) VALUES ('John', 'Doe')
Jeff Ash<br /><a href="http://www.excellentiasoftware.com" target="_blank" rel="nofollow">Excellentia Software</a>
I agree. Here's the link:
subject: how to create sequence in mysql
Alternative flows on sequence diagrams in part 2...
How Retrieve information about a file.
Is there a generic way to get sequence
Using JDBC.... I have no clue what I'm doing.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013