|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
'2022/7/8 10:00:06' '轴承' 2 1 '5~8' 5 5 0
'2022/7/8 10:00:06' '统计件1' 2 1 '5~8' 1 1 0
'2022/7/8 10:00:06' '传感器' 3 1 '2~4' 2 2 0
'2022/7/8 10:00:06' '油门杆' 3 1 '2~4' 0 0 1
T2如上所示,是从excel读取为table类型的数据
T2 = readtable('D:\A桌面移动新桌面\维修策略优化\备件.xlsx');
conn = database('SnowSweeper','','');
exec(conn, 'delete from SnowSweeper.dbo.spare_part_program');
insert(conn, 'SnowSweeper.dbo.spare_part_program',{'datetime', 'part_name', 'task_type', 'need_part_num', 'need_part_time', 'stock_num', 'longterm_num', 'purchase_num'}, T2)
close(conn)
然后出现的报错是
错误使用 database.internal.utilities.DatabaseUtils.validateStruct (line 80)
Input structure, dataset or table incorrectly formatted. See help for details
出错 database.odbc.connection/insert (line 140)
data = database.internal.utilities.DatabaseUtils.validateStruct(data);
出错 real_BC_Evaluate7 (line 434)
insert(conn, 'SnowSweeper.dbo.spare_part_program',{'datetime', 'part_name', 'task_type', 'need_part_num', 'need_part_time', 'stock_num',
'longterm_num', 'purchase_num'}, T2) |
|