Field 'BIOMETRIC_FLAG' doesn't have a default value

Hi,
i am trying to insert data into a table but i am getting this error.
Field 'BIOMETRIC_FLAG' doesn't have a default value
INSERT INTO mytab (CLIENT_ID,DAD_ID,LOCATION,DESCRIPTION) VALUES (1,1,'Default','First Data Acquisition Device');
where 'BIOMETRIC_FLAG'  is a field in the table and it is defined in the table as
BIOMETRIC_FLAG                CHAR(1)                           NULL
please help me in resolvin this error.
rgds,
vijji
vijji_lakshmiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

UmeshSenior Principal Technical Support EngineerCommented:
You provided values for 4 columns. But column 'BIOMETRIC_FLAG' MUST be filled in because you have no default set for it. Otherwise what is MySQL supposed to fill 'BIOMETRIC_FLAG' with?

Please post the output of below..

desc mytab;
0
vijji_lakshmiAuthor Commented:
Hi, i mentioned in table def that BIOMETRIC_FLAG  can be null.
if i don't supply any thing i suppose it should keep null or blank.
any way ia have provided deble strusture below.
please let me know the solution.

+-------------------+-------------+------+-----+---------+-------+
| Field             | Type        | Null | Key | Default | Extra |
+-------------------+-------------+------+-----+---------+-------+
| CLIENT_ID         | int(11)     | NO   |     |         |       |
| DAD_ID            | int(11)     | NO   |     |         |       |
| LOCATION          | varchar(20) | YES  |     | NULL    |       |
| DESCRIPTION       | varchar(40) | YES  |     | NULL    |       |
| NAME              | varchar(20) | YES  |     | NULL    |       |
| CONNECTION_TYPE   | int(11)     | YES  |     | NULL    |       |
| PRIMARY_ADDRESS   | varchar(50) | YES  |     | NULL    |       |
| SECONDARY_ADDRESS | varchar(50) | YES  |     | NULL    |       |
| TERTIARY_ADDRESS  | varchar(50) | YES  |     | NULL    |       |
| BIOMETRIC_FLAG    | char(1)     | YES  |     | NULL    |       |
| TIME_ZONE         | varchar(50) | YES  |     | NULL    |       |
| DAYLIGHT          | char(1)     | YES  |     | NULL    |       |
+-------------------+-------------+------+-----+---------+-------+
0
UmeshSenior Principal Technical Support EngineerCommented:
Pls send this..

show create table mytab;

and

show variables like 'sql_mode';
0
The Five Tenets of the Most Secure Backup

Data loss can hit a business in any number of ways. In reality, companies should expect to lose data at some point. The challenge is having a plan to recover from such an event.

vijji_lakshmiAuthor Commented:
| dad_m | CREATE TABLE `mytab` (
  `CLIENT_ID` int(11) NOT NULL,
  `ID` int(11) NOT NULL,
  `LOCATION` varchar(20) DEFAULT NULL,
  `DESCRIPTION` varchar(40) DEFAULT NULL,
  `NAME` varchar(20) DEFAULT NULL,
  `CONNECTION_TYPE` int(11) DEFAULT NULL,
  `PRIMARY_ADDRESS` varchar(50) DEFAULT NUL
  `SECONDARY_ADDRESS` varchar(50) DEFAULT N
  `TERTIARY_ADDRESS` varchar(50) DEFAULT NU
  `BIOMETRIC_FLAG` char(1),
  `TIME_ZONE` varchar(50) DEFAULT NULL,
  `DAYLIGHT` char(1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
0
vijji_lakshmiAuthor Commented:
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| sql_mode      |       |
+---------------+-------+
0
UmeshSenior Principal Technical Support EngineerCommented:
This works..


CREATE TABLE `mytab` (
  `CLIENT_ID` int(11) NOT NULL,
  `DAD_ID` int(11) NOT NULL,
  `LOCATION` varchar(20) DEFAULT NULL,
  `DESCRIPTION` varchar(40) DEFAULT NULL,
  `NAME` varchar(20) DEFAULT NULL,
  `CONNECTION_TYPE` int(11) DEFAULT NULL,
  `PRIMARY_ADDRESS` varchar(50) DEFAULT NULL,
  `SECONDARY_ADDRESS` varchar(50) DEFAULT NULL,
  `TERTIARY_ADDRESS` varchar(50) DEFAULT NULL,
  `BIOMETRIC_FLAG` char(1),
  `TIME_ZONE` varchar(50) DEFAULT NULL,
  `DAYLIGHT` char(1)
)
 
INSERT INTO mytab (CLIENT_ID,DAD_ID,LOCATION,DESCRIPTION) VALUES (1,1,'Default','First Data Acquisition Device');
 
 
SELECT * from mytab;
 
1		1		Default		First Data Acquisition Device		\N		\N		\N		

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.