为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:DM8
【操作系统】:win11
【CPU】:锐龙
【问题描述】*:执行 Merge into 的达梦 sql ,报错说是 > 尖括号附件有问题,但 sql 并没有 > 这个尖括号。
org.springframework.jdbc.BadSqlGrammarException:
### Error updating database. Cause: dm.jdbc.driver.DMException: line 4, column 970139, nearby [>] has error:
Syntax error
### The error may exist in class path resource [mapper/ArchiveFarmCropDayOutputMapper.xml]
### The error may involve com.za.archive.mapper.ArchiveFarmCropDayOutputMapper.batchInsert
### The error occurred while executing an update
### SQL: MERGE INTO TBL_ARCHIVE_FARM_CROP_DAY_OUTPUT o using ( select ? companyId, ? companyName, ? companyCategoryId, ? companyCategoryName, ? supervisionFlag, ? farmId, ? farmName, ? provinceId, ? provinceName, ? cityId, ? cityName, ? countyId, ? countyName, ? townId, ? townName, ? villageId, ? villageName, ? farmAddress, ? statisticsFlag, ? businessCategoryIds, ? businessCategoryNames, ? cropUnit, ? cropId, ? cropName, ? cropImgUrl, ? cropGroupId, ? cropGroupName, ? cropGroupImgUrl, ? cropCategoryId, ? cropCategoryName, ? cropCategoryLogoUrl, ? cropCategoryIdentifier, ? cropSubjectId, ? cropSubjectName, ? cropSubjectLogoUrl, ? cropSubjectIdentifier, ? lvyecaiFlag, ? sownArea, ? output, ? archiveDayStr,now() createTime,now() updateTime, ? outputArea from dual UNION ALL select ? companyId, ? companyName, ? companyCategoryId, ? companyCategoryName .......
详细的 报错堆栈在附件
error1.txt
报错信息是Exceed max parameters permit(65535),绑定参数不能超过65535个。
批量绑定几万个参数会导致性能下降,不建议这样使用。
建议尝试采用addBatch 、executeBatch等方式