起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1178|回复: 3

[处理中3] ksql 错误

[复制链接]

138

主题

364

帖子

1339

积分

金牌会员

Rank: 6Rank: 6

积分
1339
QQ
发表于 2021-4-29 14:07:56 | 显示全部楼层 |阅读模式
版本: 小版本号:
数据库: 服务器操作系统: 应用服务器:
客户端操作系统: 浏览器:
Caused by: com.justep.exception.BusinessException: 编码: JUSTEP150210; 提示: 执行KSQL出错, KSQL: select a.lecturer_empno,(CASE WHEN (sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1))-SQL.CAST(sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1) AS int)<0.5 AND (sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1))-SQL.CAST(sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1) AS int)>0 THEN SQL.CAST(SQL.CAST(sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1) AS int) AS decimal)+ 0.5 WHEN SQL.CAST(sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1) AS int)-(sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1)) = 0.5 THEN (sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1)) ELSE SQL.CAST(sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1)AS int) END)AS totaltime,(CASE WHEN (sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1))-SQL.CAST(sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1) AS int)<0.5 AND (sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1))-SQL.CAST(sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1) AS int)>0 THEN SQL.CAST(SQL.CAST(sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1) AS int) AS decimal)+ 0.5 WHEN SQL.CAST(sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1) AS int)-(sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1)) = 0.5 THEN (sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1)) ELSE SQL.CAST(sum(SQL.NVL(a.duration, 0)+ SQL.NVL(a.out_duration, 0))/(LENGTH(REPLACE(a.lecturer_empno, ';', ';;'))-LENGTH(a.lecturer_empno)+ 1)AS int) END)* 2 AS credit from train_apply a where a.flow_id in ('FlowEndNode    ') and a.classtype = 1  and a.lecturer_empno like '%000972%' group by a.lecturer_empno
--> sql:
--> binds: []
at com.justep.exception.BusinessException.create(Unknown Source)
at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
at com.justep.system.data.KSQL.select(Unknown Source)
at Score.queryOracleMysql(Score.java:76)
... 30 more
Caused by: com.justep.exception.KSQLException: 编码: JUSTEP154115; 提示: KSQL语法错误, rer_empno)+ 1) ^^AS int)<0.5 AND中未找到需要的元素, 位置308期望是)
at com.justep.exception.KSQLException.create(Unknown Source)
at com.justep.system.ksql.token.TokenManager.matchToken(Unknown Source)
at com.justep.system.ksql.token.TokenManager.match(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.localSqlFunctionExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.unaryExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.multiExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.addExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.compExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.notExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.andExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.orExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.whenNode(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.caseNode(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.unaryExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.multiExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.addExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.compExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.notExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.andExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.orExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.unaryExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.multiExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.addExpression(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.selectColumn(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.selectListNode(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.selectSentenceNode(Unknown Source)
at com.justep.system.ksql.parser.QueryParser.start(Unknown Source)
at com.justep.system.ksql.parser.QueryParser.start(Unknown Source)
at com.justep.system.ksql.parser.AbstractParser.parse(Unknown Source)
... 35 more

138

主题

364

帖子

1339

积分

金牌会员

Rank: 6Rank: 6

积分
1339
QQ
 楼主| 发表于 2021-4-29 14:28:26 | 显示全部楼层
这是KSQL语句
捕获.PNG
回复 支持 反对

使用道具 举报

138

主题

364

帖子

1339

积分

金牌会员

Rank: 6Rank: 6

积分
1339
QQ
 楼主| 发表于 2021-4-29 14:31:04 | 显示全部楼层
上述代码去点个别函数前的SQL.之后,执行SQL语句是没有问题的
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2021-4-29 15:16:47 | 显示全部楼层
把<0.5改为=执行看看

不行就用sql实现,KSQL对目前情况的转换可能有问题
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-11-24 05:26 , Processed in 0.064492 second(s), 28 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表