|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Virtual Tradeshows by Ziff Davis Enterprise – A Unique Opportunity to Interact with IT Experts, Access Information, and Gain Insight on Today’s Trends in Technology Learn more
|
|
#1
|
|||
|
|||
|
i am trying to create a table in mysql :-
create table test (en1 (enum('Y','N' default 'N' not null, id int auto_increment primary key, field1 char(10)); when i insert using :- insert into test('1',null,'test'); then i check the values in the test using select :- en1 id field1 1 test the value in en1 is null ? when i specify it is not null. i am trying to make the en1 as a boolean field which can accept 1 or 0 or y or n. how do i do that and also the not null - it must be a not null ? lost .... in mysql... please help.... thanks a lot |
|
#2
|
|||
|
|||
|
The problem is when you make the table you are using incorrect syntax.
Here is the proper syntax you should be using: create table test( en1 enum('Y','N') not null default 'N', id int not null auto_increment, field1 varchar(10), primary key (id), ); Hope that helps... |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > default value for enum ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|