If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > how create table with data type Enum and autoincrement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-18-10, 14:18
clavijo83 clavijo83 is offline
Registered User
 
Join Date: Jun 2010
Posts: 4
how create table with data type Enum and autoincrement

hi.

im dummie in db 2, i like create a table with data type Enum an data with property auto increment. my query in Mysql is this:

CREATE TABLE bines (
id int(6) NOT NULL auto_increment,
tipo_tarjeta enum('CREDITO','DEBITO','AMEX') NOT NULL,
inicio int(6) NOT NULL,
fin int(6) NOT NULL,
tarjeta_id int(6) NOT NULL,
PRIMARY KEY (`id`) ) ;

how is the query in db2?
please help me.
Reply With Quote
  #2 (permalink)  
Old 06-18-10, 14:47
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
I am not too familiar with the ENUM data type, but isn't this the same as defining the data as CHAR and adding a check constraint?
Dave
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On