MySQL FAQs
FAQs Categories
Client Server Commands
Database Structure
Table Types or Storage Engines
Indexes
SQL Statements
Table Joins
Funtions and Operators
Tricky Select Queries
Speed Up Queries
Data Back Up
General Questions
Errors
1PLs Company - #1Payday.Loans Agency - Loans online and near me $100-$2500 (Same Day)
Powered by MySQL
 
Home / Errors / Question No: 97

1264 Out of range value adjusted for column

I am getting the MySQL error #1264 - Out of range value adjusted for column 'id' at row 1 when I try to run my INSERT query. With me MySQL server version is 5.0.24a-community-max-nt-log and my table structure is as follow:

CREATE TABLE `tbl_oer` (
`id` int(11) NOT NULL auto_increment,
`programid` int(11) default NULL,
`workshop` varchar(250) default NULL,
`fname` varchar(250) default NULL,
`lname` varchar(250) default NULL,
`designation` varchar(250) default NULL,
`organization` varchar(250) default NULL,
`experience` varchar(250) default NULL,
`contactno` varchar(250) default NULL,
`mobile` varchar(255) default NULL,
`email` varchar(250) default NULL,
`nominatedby_section_b` varchar(250) default NULL,
`designation_section_b` varchar(250) default NULL,
`address_section_b` varchar(250) default NULL,
`telephone_section_b` varchar(250) default NULL,
`mobile_section_b` varchar(255) default NULL,
`fax_section_b` varchar(250) default NULL,
`email_section_b` varchar(250) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
My sample insert query, which gets error the error $1264 is below:
INSERT INTO tbl_oer values('', '18', '', 'testsaleem', 'test', 
'', '', '', '', '',
'saleem@website-developer-service.com',
'', '', '', '', '', '', '');
Can you help to fix problem if exists in the above query?

Answer No: 97

The error 1264 Out of range value adjusted for column mostly occurs when INSERT query makes try to insert an empty value into a NOT NULL field. So 'id' is a NOT NULL field in your table against which you are inserting empty ('') value. Means, you must pass some value instead of empty value against NOT NULL type field. Further, because your id field is also AUTO_INCREMENT so you can change your query by passing NULL value against the id field. Change your query from:

INSERT INTO tbl_oer values('', '18', '', 'testsaleem', 'test',
'', '', '', '', '',
'saleem@website-developer-service.com',
'', '', '', '', '', '', '');
to
INSERT INTO tbl_oer values(NULL, '18', '', 'testsaleem', 'test',
'', '', '', '', '',
'saleem@website-developer-service.com',
'', '', '', '', '', '', '');

Related MySQL FAQs to the Above FAQ

Why-I-see-an-error-when-I-EXPLAIN-for-update-query Why I see an error when I EXPLAIN for update query?

ERROR-1295-(HY000):-This-command-is-not-supported-in-the-prepared-statement-protocol-yet ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet

ERROR-1064-(42000):-You-have-an-error-in-your-SQL-syntax ERROR 1064 (42000): You have an error in your SQL syntax

1048-Column-cannot-be-null 1048 Column cannot be null

1093-You-can-not-specify-target-table-comments-for-update-in-FROM-clause 1093 You can not specify target table comments for update in FROM clause

1191-Cant-find-FULLTEXT-index-matching-the-column-list 1191-Cant find FULLTEXT index matching the column list

About FAQs: Recently Added FAQs

About MySQL FAQs: Site Map | Bookmark Us | Recommend this Site to Your Friend | Contact Us

Useful Links: Wikipedia.org | Oracle.com | w3schools.com | www.php.net | Github.com

© 2023  www.mysqlfaqs.net
All rights reserved.