Última atualização: 09/Dec/2016 RSS
A A A
Home...

Not&icute;cia

AUTO_INCREMENT on DB2

DB2 provides support for automatically generated identity columns using the GENERATE ALWAYS AS IDENTITY. The AUTOINCREMENT clause is not supported in DB2. See an example:

a) Table on MySQL:

CREATE TABLE `tb_email` (
`email_id` int(10) NOT NULL auto_increment,
`email_txt` varchar(50),
PRIMARY KEY (`email_id`)
);

b) Table on DB2:

CREATE TABLE `tb_email` (
(email_id INTEGER GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
`email_txt` varchar(50),
PRIMARY KEY (`email_id`)
);


(03.03.2006) http://www.dcon.com.br/jd.comment/home.php?cont_id=578

Comment!View Comments


Ver todas as publicações









powered by: DCON Tecnologia da Informação Ltda.