I have sql table:
-- Table structure for rb_amazon_daily -- ---------------------------- DROP TABLE IF EXISTS `rb_amazon_daily`; CREATE TABLE `rb_amazon_daily` ( `id` int(11) NOT NULL AUTO_INCREMENT, `date` date DEFAULT NULL, `book_title` varchar(255) DEFAULT NULL, `marketplace` varchar(255) DEFAULT NULL, `amazon_kdp_avg_list_price` decimal(12,10) DEFAULT NULL, `amazon_kdp_royalty_type` varchar(255) DEFAULT NULL, `amazon_kdp_revenue_in_usd` decimal(13,13) DEFAULT NULL, `amazon_kdp_royalty_in_usd` decimal(13,13) DEFAULT NULL, `amazon_kdp_paid_downloads` int(11) DEFAULT NULL, `amazon_kdp_free_downloads` int(11) DEFAULT NULL, `amazon_ku_pages_read` int(11) DEFAULT NULL, `amazon_ku_revenue_in_usd` decimal(12,10) DEFAULT NULL, `create_space_revenue_in_usd` decimal(12,10) DEFAULT NULL, `create_space_royalty_in_usd` decimal(12,10) DEFAULT NULL, `create_space_paperbacks_sold` int(11) DEFAULT NULL, `daily_total_revenue` decimal(12,10) DEFAULT NULL, `daily_total_royalty` decimal(12,10) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=301 DEFAULT CHARSET=latin1; class AmazonDaily < ActiveRecord::Base self.table_name = "rb_amazon_daily" end But then when I try to save somedata to database
#<AmazonDaily:0x007fffef743a00 id: nil, date: Sat, 16 Jul 2016, book_title: "Catalyst Moon: Incursion", marketplace: "Amazon.com", amazon_kdp_avg_list_price: 0.299e1, amazon_kdp_royalty_type: "70%", amazon_kdp_revenue_in_usd: 0.598e1, amazon_kdp_royalty_in_usd: 0.408e1, amazon_kdp_paid_downloads: 2, amazon_kdp_free_downloads: 0, amazon_ku_pages_read: 0, amazon_ku_revenue_in_usd: 0.0, create_space_revenue_in_usd: 0.0, create_space_royalty_in_usd: 0.0, create_space_paperbacks_sold: 0, daily_total_revenue: 0.598e1, daily_total_royalty: 0.408e1> I got an error: Error: Out of range value for column `
home/jonsdirewolf/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/mysql2-0.4.9/lib/mysql2/client.rb:120:in
_query': Mysql2::Error: Out of range value for column 'amazon_kdp_revenue_in_usd' at row 1: INSERT INTOrb_amazon_daily(date,book_title,marketplace,amazon_kdp_avg_list_price,amazon_kdp_royalty_type,amazon_kdp_revenue_in_usd,amazon_kdp_royalty_in_usd,amazon_kdp_paid_downloads,amazon_kdp_free_downloads,amazon_ku_pages_read,amazon_ku_revenue_in_usd,create_space_revenue_in_usd,create_space_royalty_in_usd,create_space_paperbacks_sold,daily_total_revenue,daily_total_royalty`) VALUES ('2016-07-16', 'Catalyst Moon: Incursion', 'Amazon.com', 2.99, '70%', 5.98, 4.08, 2, 0, 0, 0.0, 0.0, 0.0, 0, 5.98, 4.08) (ActiveRecord::StatementInvalid)
` What do I do?
