因此,我尝试使用 matlab 中的数据库工具箱在我的研究实验室中查询数据库,并且在一台特定的计算机上,每次运行 SAME 查询命令时,它从相同查询返回的结果都会发生变化。
connPV = database('dbname','username','password');
Images = fetch(handles.connPV,['SELECT i.id, i.image_type_id, i.image_subtype_id, i.series_description, i.image_file_path, i.date_of_image as studydates, ST.subtype_name, i.pretreatment_flag FROM images i JOIN image_subtypes ST在 ST.id = i.image_subtype_id WHERE i.patient_id = ' num2str(45) ' AND ST.subtype_name NOT LIKE "T0%" ORDER BY i.date_of_image'])
关闭(connPV);
以下是执行相同代码行 3 次的结果:
图片 = id: [20x1 double] image_type_id: [20x1 double] image_subtype_id: [20x1 double] series_description: {20x1 cell} image_file_path: {20x1 cell} studydates: {20x1 cell} subtype_name: {20x1 cell} pretreatment_flag: {20x1 cell}
图像 = id:[19x1 双] image_type_id:[19x1 双] image_subtype_id:[19x1 双] series_description:{19x1 细胞} image_file_path:{19x1 细胞} studydates:{19x1 细胞} subtype_name:{19x1 细胞} pretreatment_flag:{19x1 细胞}
图片 = id: [5x1 double] image_type_id: [5x1 double] image_subtype_id: [5x1 double] series_description: {5x1 cell} image_file_path: {5x1 cell} studydates: {5x1 cell} subtype_name: {5x1 cell} pretreatment_flag: {5x1 cell}
每次,它返回不同数量的值。但是,如果我打开 mysql 的查询浏览器并运行命令,它每次都有效。
我想清楚的是,这个问题是特定于特定计算机的。当我的脚本在实验室的其他计算机上执行时,它运行良好。它出现故障的计算机是 Win7 X64,但实验室中还有其他 X64;但是,这是唯一的 Win7 计算机。
我重新安装了matlab、mysql驱动和数据库工具箱,在2009b和2010a上试了一下。对于这样一个奇怪的错误,我已经没有想法了……有什么想法吗?
谢谢!
泰勒