•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 375,199 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,979 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 1002 | Replies: 19 | Solved
![]() |
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 174
Reputation:
Rep Power: 1
Solved Threads: 20
I've run into similar problems, and sometimes the culprit is a value before the indicated one.
I notice some anomalies with your INSERT statement.
First are those really back-ticks surrounding the table name and field names? Why do you need them? What database are you using?
Second, there seems to be a mis-match in the number of fields. You have 17 in the 'INSERT INTO' section, but it looks like you are trying to insert more fields. If you look at your data, you will see that you first try to insert only 12 fields, then another insert of 17. The data may be corrupt at that point.
And why are you double-quoting what appear to be numeric data? The value just before the 'tax2st' value is
I notice some anomalies with your INSERT statement.
First are those really back-ticks surrounding the table name and field names? Why do you need them? What database are you using?
Second, there seems to be a mis-match in the number of fields. You have 17 in the 'INSERT INTO' section, but it looks like you are trying to insert more fields. If you look at your data, you will see that you first try to insert only 12 fields, then another insert of 17. The data may be corrupt at that point.
And why are you double-quoting what appear to be numeric data? The value just before the 'tax2st' value is
'', 0.00, '',
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
"Others make web sites. We make web sites work!"
•
•
Join Date: Jan 2008
Posts: 18
Reputation:
Rep Power: 1
Solved Threads: 0
I am relatively new to mysql. I am running 5.0, and updating a site for someone. There was a file called echeck.sql which i was to run in order to automate a build of the database and tables. However i get this error when i try to run or import the table:
SQL query:
MySQL said: Documentation
#1265 - Data truncated for column 'taxst2' at row 1
The build kicks out and i am left with a partial database. I was told that this is due to a bug in mysql5. how do I correct it? I attempted the solution in which you download the source tree from bitkeeper. However I am running windows which so I then needed to download cygwin. I followed all the steps supplied on:
http://dev.mysql.com/doc/refman/5.0/...urce-tree.html
but when i get to the point where i need to issue the command:
shell> cd mysql-5.0
shell> (cd bdb/dist; sh s_all)
shell> (cd innobase; autoreconf --force --install)
shell> autoreconf --force --install
shell> ./configure # Add your favorite options here
shell> make
I recieve an error stating: bash: autoreconf: Command not found.
So i have 2 questions. 1. How do i correct this issue w/ attempting to install the database.
and 2.Why does bash not recognize the autoreconf command?
HEEEEEEEEEEEEELLLLLLLLLLP!!!!!
SQL query:
-- -- Dumping data for table `tbl_tax` -- INSERT INTO `tbl_tax` ( `taxid` , `taxdesc1` , `taxper1` , `taxst1` , `taxdesc2` , `taxper2` , `taxst2` , `taxdesc3` , `taxper3` , `taxst3` , `taxdesc4` , `taxamt1` , `taxst4` , `taxdesc5` , `taxamt2` , `taxst5` , `tax_prt_id` ) VALUES ( 1, 'tax1', 0.00, '1', '', 0.00, '', 'tax2', 0.00, '', 'tax4', 0.00, '1', '', 0.00, '', 26 ) , ( 2, 'taxa', 2.00, '1', 'taxb', 2.00, '1', 'taxc', 2.00, '1', 'taxd', 23.00, '1', 'taxE', 2.00, '1', 52 ) ;
#1265 - Data truncated for column 'taxst2' at row 1
The build kicks out and i am left with a partial database. I was told that this is due to a bug in mysql5. how do I correct it? I attempted the solution in which you download the source tree from bitkeeper. However I am running windows which so I then needed to download cygwin. I followed all the steps supplied on:
http://dev.mysql.com/doc/refman/5.0/...urce-tree.html
but when i get to the point where i need to issue the command:
shell> cd mysql-5.0
shell> (cd bdb/dist; sh s_all)
shell> (cd innobase; autoreconf --force --install)
shell> autoreconf --force --install
shell> ./configure # Add your favorite options here
shell> make
I recieve an error stating: bash: autoreconf: Command not found.
So i have 2 questions. 1. How do i correct this issue w/ attempting to install the database.
and 2.Why does bash not recognize the autoreconf command?
HEEEEEEEEEEEEELLLLLLLLLLP!!!!!
Last edited by peter_budo : Mar 14th, 2008 at 3:08 pm. Reason: Keep It Organized - please use [code] tags for easy readability
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 174
Reputation:
Rep Power: 1
Solved Threads: 20
And again, I am suggesting you look at the raw data. You have double quotes around part of the VALUE data:
I'm quite certain that is where the problem is.
•
•
•
•
VALUES ( 1, 'tax1', 0.00, '1', '', 0.00, '', 'tax2', 0.00, ''
Last edited by trudge : Mar 9th, 2008 at 3:58 pm.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
"Others make web sites. We make web sites work!"
•
•
Join Date: Jan 2008
Posts: 18
Reputation:
Rep Power: 1
Solved Threads: 0
Sorry, the font makes it appear that way. Those are single quotes...as in:
'1', ' ', 0.00, ' ', 'tax2'
there is a space there, it just doesnt look like it. I am running mysql 5.0
here is the full statement:
Does this look correct? The reason I am not understanding what the issue is, is that this file was created via mysqldump...this table did at one point run properly from a db, but once i try and load this dump file back into a db im getting this issue.
'1', ' ', 0.00, ' ', 'tax2'
there is a space there, it just doesnt look like it. I am running mysql 5.0
here is the full statement:
CREATE TABLE `tbl_tax` (
`taxid` bigint(50) NOT NULL auto_increment,
`taxdesc1` varchar(100) NOT NULL,
`taxper1` float(8,2) NOT NULL,
`taxst1` enum('0','1') NOT NULL default '0',
`taxdesc2` varchar(100) NOT NULL,
`taxper2` float(8,2) NOT NULL,
`taxst2` enum('0','1') NOT NULL default '0',
`taxdesc3` varchar(100) NOT NULL,
`taxper3` float(8,2) NOT NULL,
`taxst3` enum('0','1') NOT NULL default '0',
`taxdesc4` varchar(100) NOT NULL,
`taxamt1` float(8,2) NOT NULL,
`taxst4` enum('0','1') NOT NULL default '0',
`taxdesc5` varchar(100) NOT NULL,
`taxamt2` float(8,2) NOT NULL,
`taxst5` enum('0','1') NOT NULL default '0',
`tax_prt_id` int(50) NOT NULL,
PRIMARY KEY (`taxid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `tbl_tax`
--
INSERT INTO `tbl_tax` (`taxid`, `taxdesc1`, `taxper1`, `taxst1`, `taxdesc2`, `taxper2`, `taxst2`, `taxdesc3`, `taxper3`, `taxst3`, `taxdesc4`, `taxamt1`, `taxst4`, `taxdesc5`, `taxamt2`, `taxst5`, `tax_prt_id`) VALUES
(1, 'tax1', 0.00, '1', '', 0.00, '', 'tax2', 0.00, '', 'tax4', 0.00, '1', '', 0.00, '', 26),
(2, 'taxa', 2.00, '1', 'taxb', 2.00, '1', 'taxc', 2.00, '1', 'taxd', 23.00, '1', 'taxE', 2.00, '1', 52);Does this look correct? The reason I am not understanding what the issue is, is that this file was created via mysqldump...this table did at one point run properly from a db, but once i try and load this dump file back into a db im getting this issue.
Last edited by peter_budo : Mar 14th, 2008 at 3:07 pm. Reason: Keep It Organized - please use [code] tags for easy readability
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 174
Reputation:
Rep Power: 1
Solved Threads: 20
Then you are trying to insert empty data into 5 fields which are defined as NOT NULL. There seems to be some data missing.
For some debugging:
Make a copy of your original .sql file and work with the copy.
Try pulling that line out of the copied .sql file and save it into a separate file.
Delete it from the copied .sql file.
Then try running your command again on this .sql file. If all the INSERTS are OK, then you know that it is that line that is causing the problem.
For some debugging:
Make a copy of your original .sql file and work with the copy.
Try pulling that line out of the copied .sql file and save it into a separate file.
Delete it from the copied .sql file.
Then try running your command again on this .sql file. If all the INSERTS are OK, then you know that it is that line that is causing the problem.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
"Others make web sites. We make web sites work!"
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 174
Reputation:
Rep Power: 1
Solved Threads: 20
•
•
Join Date: Dec 2007
Posts: 103
Reputation:
Rep Power: 1
Solved Threads: 12
trudge is right. Actualy your MySQL is running in strict mode. Either resolve the issues which trudge has mentioned or change sql-mode.
To change sql-mode, either change the value of sql_mode to empty or ANSI in my.cnf or by executing the query for a session i.e.
To change sql-mode, either change the value of sql_mode to empty or ANSI in my.cnf or by executing the query for a session i.e.
SET sql_mode = '';
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
avatar backup badge breach building business community copy a table from one database to another database in another ms sql server using sql server management studio daniweb data data protection database design europe government hacker hp ibm medicine member news normalization security server sql survey
- Student Database Design (Database Design)
- Need some ideas on building an exam result database. Assistance appreciated. (Database Design)
- General rules for building a database (MySQL)
- An OpenSource Database (C++)
- Building a database application (C++)
- VB6 Database Program (Visual Basic 4 / 5 / 6)
Other Threads in the MySQL Forum
- Previous Thread: retrieve data frm 2 tables
- Next Thread: Incorrect string value


Linear Mode