User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Dec 2007
Posts: 103
Reputation: mwasif is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 12
mwasif mwasif is offline Offline
Junior Poster

Re: Help building database

  #11  
Mar 9th, 2008
Did you execute these commands in phpmyadmin?
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 174
Reputation: trudge is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: Help building database

  #12  
Mar 9th, 2008
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
'', 0.00, '',
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
Reply With Quote  
Join Date: Jan 2008
Posts: 18
Reputation: mexaros is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mexaros mexaros is offline Offline
Newbie Poster

Re: Help building database

  #13  
Mar 9th, 2008
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:

-- 
-- 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 ) ;
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!!!!!
Last edited by peter_budo : Mar 14th, 2008 at 3:08 pm. Reason: Keep It Organized - please use [code] tags for easy readability
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 174
Reputation: trudge is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: Help building database

  #14  
Mar 9th, 2008
And again, I am suggesting you look at the raw data. You have double quotes around part of the VALUE data:
VALUES ( 1, 'tax1', 0.00, '1', '', 0.00, '', 'tax2', 0.00, ''
I'm quite certain that is where the problem is.
Last edited by trudge : Mar 9th, 2008 at 3:58 pm.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
Reply With Quote  
Join Date: Jan 2008
Posts: 18
Reputation: mexaros is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mexaros mexaros is offline Offline
Newbie Poster

Help Re: Help building database

  #15  
Mar 9th, 2008
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:


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
Reply With Quote  
Join Date: Jan 2008
Posts: 18
Reputation: mexaros is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mexaros mexaros is offline Offline
Newbie Poster

Help Re: Help building database

  #16  
Mar 9th, 2008
I could see where the font can play games, it appeared as though i was only inserting 12 objects but , '', was one of the 17 inserts
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 174
Reputation: trudge is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: Help building database

  #17  
Mar 9th, 2008
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.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 174
Reputation: trudge is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: Help building database

  #18  
Mar 9th, 2008
Just a caution. If you've already successfully INSERTED some records, before you try another one, you may have to empty the table, otherwise you will get duplicated data.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
Reply With Quote  
Join Date: Dec 2007
Posts: 103
Reputation: mwasif is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 12
mwasif mwasif is offline Offline
Junior Poster

Re: Help building database

  #19  
Mar 14th, 2008
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.
SET sql_mode = '';
Reply With Quote  
Join Date: Jan 2008
Posts: 18
Reputation: mexaros is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mexaros mexaros is offline Offline
Newbie Poster

Re: Help building database

  #20  
Mar 19th, 2008
Thanks to both trudge and mwasif. this helped correct the issue
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MySQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 2:28 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC