Error No 1292 In Mysql
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About error incorrect datetime value Us Learn more about Stack Overflow the company Business Learn more about hiring
Mysql Error Code 1292
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the mysql error 1292 truncated incorrect double Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up error code 1292 incorrect date value mysql 1292 truncated incorrect integer value mysql up vote 8 down vote favorite 5 I have a table `CREATE TABLE IF NOT EXISTS `PROGETTO`.`ALBERGO` ( `ID` INT(11) NOT NULL COMMENT 'identificativo dell\' albergo' , `nome` VARCHAR(45) NULL COMMENT 'Il nome dell\'albergo' , `viale` VARCHAR(45) NULL COMMENT 'Il viale in cui si trova ' , `num_civico` VARCHAR(5) NULL COMMENT 'Il numero civico che gli appartiene' , `data_apertura` DATE NULL COMMENT 'Data di inizio
Mysql Warning 1292
apertura (inizio stagione)' , `data_chiusura` DATE NULL COMMENT 'Data di chiusura (fine stagione)' , `orario_apertura` TIME NULL COMMENT 'Orario di apertura' , `orario_chiusura` TIME NULL COMMENT 'Orario di chiusura' , `posti_liberi` INT(11) NULL COMMENT 'Disponiblità posti liberi ' , `costo_intero` FLOAT NULL COMMENT 'Costo del prezzo intero' , `costo_ridotto` FLOAT NULL COMMENT 'Costo del prezzo ridotto' , `stelle` INT(11) NULL COMMENT 'Classificazione in base al criterio delle stelle' , `telefono` VARCHAR(15) NULL COMMENT 'Recapito telefonico' , `mail` VARCHAR(100) NULL COMMENT 'Recapito e-mail' , `web` VARCHAR(100) NULL COMMENT 'Sito Web relativo all\'ente' , 'Nome-paese` VARCHAR(45) NOT NULL COMMENT 'Identificativo del paese in cui si trova l\'albergo' , `Comune` CHAR(2) NOT NULL COMMENT 'Identificativo del comune in cui si trova l\'albergo' , PRIMARY KEY (`ID`) , INDEX `Nome-paese` (`Nome-paese` ASC) , INDEX `Comune` (`Comune` ASC) , CONSTRAINT `Nome-paese` FOREIGN KEY (`Nome-paese` ) REFERENCES `PROGETTO`.`PAESE` (`Nome-paese` ) ON DELETE NO ACTION ON UPDATE CASCADE, CONSTRAINT `Comune` FOREIGN KEY (`Comune` ) REFERENCES `PROGETTO`.`PAESE` (`Comune` ) ON DELETE NO ACTION ON UPDATE CASCADE) ENGINE = InnoDB When i try to run this query: INSERT INTO `PROGETTO`.`ALBERGO`(`ID`, `nome`, `viale`, `num_civico`, `data_apertura`, `data_chiusura`, `orario_apertura`, `orario_chiusura`, `posti_liberi`, `costo_intero`, `costo_ridotto`, `stelle`, `telefono`, `mail`, `web`, `Nome-paese
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the mysql error code 1292 truncated incorrect double value workings and policies of this site About Us Learn more about Stack mysql error code 1292 incorrect datetime value Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Error 1292 Incorrect Date Value
Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join http://stackoverflow.com/questions/14625191/error-code-1292-incorrect-date-value-mysql them; it only takes a minute: Sign up MySQL Error 1292 on insert text up vote 1 down vote favorite 2 I am trying to insert a combination of 2 fields into one field and every time I do this I get an error about truncating data. The code: insert into sharppatentdb.Inventor (InventorFull) select InventorFirst + " " + http://stackoverflow.com/questions/15750572/mysql-error-1292-on-insert-text InventorLast from sharppatentdb.inventorsource; The error: Error Code: 1292. Truncated incorrect DOUBLE value: 'Rossi-Wolter' All source fields are VARCHAR(64) The InventorFull field is VARCHAR(511) What am I doing wrong? mysql sql insert mysql-error-1292 share|improve this question edited Apr 2 '13 at 14:09 asked Apr 1 '13 at 19:45 Johnny B 215312 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted So the problem is that InventorFull needs to be 511 characters based on this statement: All fields are VARCHAR(255) because somewhere in the mix the concatenation of the two fields InventorFirst, the single space, and InventorLast is greater than 255 characters. When you build fields for concatenated values they need to be the combined size of both fields as well as any additional characters. To more clearly depict the reason that your InventorFull field needs to be 511 characters - your two fields are 255 characters and you're adding a single character in between: 255 + 255 + 1 = 511 further, as shown in the comments, it's worth noting that
Craig David Email Updates: Status: Not a Bug Impact on me: None Category:MySQL Server: Errors Severity:S3 (Non-critical) Version:5.6.12 Win32 (x86) OS:Microsoft Windows Assigned to: View Add Comment Files Developer Edit Submission View Progress Log Contributions [29 https://bugs.mysql.com/bug.php?id=70188 Aug 2013 21:33] Craig David Description: I have a table with a timestamp column (type timestamp) and I try to insert the following into the table. The follow does not work insert into backup.test (timestamp) values ('2013-03-10 02:01:03') insert into backup.test (timestamp) values ('2013-03-10 02:02:03') Data Truncation error occured on a write of column 0Data was 0 bytes long and 0 bytes were transferred. This works. insert into backup.test (timestamp) values ('2013-03-11 mysql error 02:01:03') insert into backup.test (timestamp) values ('2013-03-09 02:01:03') insert into backup.test (timestamp) values ('2013-03-10 12:01:03') How to repeat: Create a single timestamp column in a table. I have created a simple table with only one column (timestamp) and it fails. insert into backup.test (timestamp) values ('2013-03-10 02:01:03') insert into backup.test (timestamp) values ('2013-03-10 02:02:03') There might other combinations but i think you get the idea. [29 Aug 2013 21:57] Miguel Solorzano Thank mysql error code you for the bug report. Please check for timezone issue. Thanks. Enter password: ****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 12 Server version: 5.6.13 MySQL Community Server (GPL) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create database backup; Query OK, 1 row affected (0.02 sec) mysql> create table backup.test (timestamp timestamp); Query OK, 0 rows affected (0.38 sec) mysql> insert into backup.test (timestamp) values ('2013-03-10 02:01:03'); Query OK, 1 row affected (0.05 sec) mysql> insert into backup.test (timestamp) values ('2013-03-10 02:02:03'); Query OK, 1 row affected (0.06 sec) mysql> select * from backup.test; +---------------------+ | timestamp | +---------------------+ | 2013-03-10 02:01:03 | | 2013-03-10 02:02:03 | +---------------------+ 2 rows in set (0.00 sec) [29 Aug 2013 23:04] Craig David Thank for quick response. I noticed that you were using 5.6.13 and not 5.6.12.. I'm not sure how the timezone could an issue as the month and day that fail are under 12.. Can you please let me know what and how I should work with ti