mysql - SQLSTATE[22003] : Numeric value out of range: 1264 Out of range value

标签 mysql laravel

我从 WAMP 服务器得到的小数是小数 (5,2) 我的查询异常:

SQLSTATE[22003]:数值超出范围:1264 第 1 行“converted_1000ml”列的值超出范围(SQL:插入 inventory_databanks(product_descnc_os, ncos_value, del, ei, sa, wh, bi, brand, variant, type, content, conversion_1000ml**converted_1000ml**osbopeso_salesbo_case, os_case, del_case, wh_case, sa_case, price >, facing, maker, merchandiser_name, complete_address, source_type, payroll_period, cellphone, schedule, area, region, , city_municipality, outlet, edi_branch, 销售员, ns_case1, ns_case2, ns_case3, ns_bottles1, ns_bottles2, ns_bottles3, ns_date1, ns_date2, ns_date3, date_started code>, inventory_date, updated_at, created_at) 值 (Emperador_Light 1000mL Light Brandy, With Stocks, With Stocks, 2400, 4734, 78, 4656, 245, Emperador_Light, 白兰地, 原味, 1000, 1.00, 4734.00, 0, 0, -229790, 0, 0, 0, 0, 0, 110.00, 13, EDI, Rodolfo Siongco Jr, null, 来自库存表, 01/16/2018 - 01/31/2018, 09303243249, T-TH-S, Central Luzon, Region III, Bataan, Mariveles, CORA'S, Pampanga Branch, Angelito Quetua, 0, 0, 0, 0, 0, 0, 2018-01-31, 2018-01-31, 2018-01-31, 2018-01-16, 1970-01-01, 2018-02-08 08:49 :48, 2018-02-08 08:49:48))

我该如何解决这个问题?粗体数字我认为这是我的问题

最佳答案

小数 (5,2) 的范围是 -999.99 到 999.99。您将不得不更改该列以保存较大的值。

salary DECIMAL(5,2)

In this example, 5 is the precision and 2 is the scale. The precision represents the number of significant digits that are stored for values, and the scale represents the number of digits that can be stored following the decimal point.

Standard SQL requires that DECIMAL(5,2) be able to store any value with five digits and two decimals, so values that can be stored in the salary column range from -999.99 to 999.99.

Documentation

关于mysql - SQLSTATE[22003] : Numeric value out of range: 1264 Out of range value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48681491/

相关文章:

mysql - 尝试加载 JDBC 接收器连接器时出错

javascript - php & JS 聊天,在聊天窗口中执行 html

php - 更改 mysql 数据库以查询 mysqli db?

php - Laravel Blade 模板 Form::open() 到 Html

laravel - Laravel 上的多个 SESSION_DOMAIN

postgresql - 将值传递给 Laravel 数据库占位符

php - 尝试访问我的数据库时访问被拒绝

php - 在以下情况下如何使用 mod_rewrite 获取简短的唯一 URL?

php - 无法在 Excel::load() 之外获取对象名称值

javascript - 获取图像未找到 404,API laravel