问题描述:报表—>库龄分析报表打开页面数据加载失败
问题截图:
错误日志:
select product_id,store_name,product_name,product_num,product_sort,product_model,product_code, bar_code,car_brand,car_sort,sum(amount) as total_amount,unit_id,unit_name, sum(case when (day_count>=0 and day_count<=30) then amount else null end) as area1, sum(case when (day_count>=31 and day_count<=60) then amount else null end) as area2, sum(case when (day_count>=61 and day_count<=90) then amount else null end) as area3, sum(case when (day_count>=91 and day_count<=120) then amount else null end) as area4, sum(case when (day_count>=121 and day_count<=180) then amount else null end) as area5, sum(case when (day_count>=181 and day_count<=365) then amount else null end) as area6, sum(case when (day_count>=366 and day_count<=730) then amount else null end) as area7, sum(case when day_count>=731 then amount else null end) as area8 from dbo.getRemainInStore('2019-01-03') a left join (select product_id as pid,unit_id from t_product)c on a.product_id=c.pid left join (select unit_id as uid,unit_name from t_unit)d on c.unit_id=d.uid where 1=1 and exists (select store_name from t_user_store where user_name ='店长' and store_name = a.store_name ) group by product_id,store_name,product_name,product_num,product_sort,product_model,product_code,bar_code,car_brand,car_sort,unit_id,unit_name
问题版本号:
V6.18.1214
问题原因:
数据库的表值函数(getRemainInStore)中的语句错误。getRemainInStore表中的拼音码字段长度与t_product中的拼音码长度不一致。
这种情况在货品的拼音码长度超过50字符时,使用这个函数会提示:将截断字符串或二进制数据。
解决方案:
执行升级语句