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

QQ登录

只需一步,快速开始

查看: 3182|回复: 4

[结贴] 3.6 ksql 关联子查询报错,标识符长度过长

[复制链接]

423

主题

813

帖子

3035

积分

论坛元老

Rank: 8Rank: 8

积分
3035
QQ
发表于 2017-6-15 18:08:22 | 显示全部楼层 |阅读模式
select
*from A optional join B on A=B.fMasterID optional join (select TableC.fXXXXX as fXXXX from TableC TableC) D on b.fXXXX=D.fXXXX
在ksql编辑器中 提示标识符长度过长,把TableC的别名换成C 就不报错了,
而且在报错信息中 fXXXX 这个字段变成了 TableC.fXXXXX_fXXXX ,下面多了一个横线

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36069
发表于 2017-6-16 08:45:38 | 显示全部楼层
as了别名也会变成TableC.fXXXXX_fXXXX ?
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

423

主题

813

帖子

3035

积分

论坛元老

Rank: 8Rank: 8

积分
3035
QQ
 楼主| 发表于 2017-6-16 09:30:38 | 显示全部楼层
jishuang 发表于 2017-6-16 08:45
as了别名也会变成TableC.fXXXXX_fXXXX ?

2017-06-16 09:23:45 excute stream action, params:{"accept":"application/json","action":"compare","actionFlag":"__action_0__","activity":"mainActivity","contentType":"application/json","parameters":{"fBillNumber":"RKD2017060184","fContractNO":"GPP2017060012"},"process":"/goodsManage/goodsManage/process/goodsInbound/goodsInboundProcess"}

java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.justep.system.action.Engine.invokeActions(Native Method)
        at com.justep.system.action.Engine.invokeActions(Unknown Source)
        at com.justep.business.server.BusinessServer.doAction(Unknown Source)
        at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:745)

Caused by: com.justep.exception.BusinessException: 编码: JUSTEP150210; 提示: 执行KSQL出错, KSQL: select C.fGoodsEncoding as fGoodsEncoding,E.fContractNO as fContractNO,B.fCount as fCount,(C.fQuantity-SQL.NVL(A.fCount,0)) AS fNeedCount from GO_InboundDetail B optional join GO_Inbound E on B.fMasterID = E optional join GO_GoodsPurchaseDetail C on C.fGoodsEncoding = B.fGoodsEncoding optional join GO_GoodsPurchase D on C.fMasterID = D and D.fBillNumber = E.fContractNO optional join (select GO_InboundDetail.fGoodsEncoding,GO_Inbound.fContractNO,SQL.NVL(sum(GO_InboundDetail.fCount),0) as fCount from GO_InboundDetail GO_InboundDetail optional join GO_Inbound GO_Inbound on GO_Inbound = GO_InboundDetail.fMasterID  where GO_Inbound.fBillStatus = '已完成' group by fGoodsEncoding,fContractNO) A on A.fGoodsEncoding = C.fGoodsEncoding and A.fContractNO = D.fBillNumber where E.fBillNumber = 'RKD2017060184' and D.fBillNumber = 'GPP2017060012'
--> sql: SELECT  C.FGOODSENCODING AS fGoodsEncoding, E.FCONTRACTNO AS fContractNO, B.FCOUNT AS fCount, ( C.FQUANTITY - NVL(A.fCount, ?) ) AS fNeedCount FROM GO_INBOUNDDETAIL B LEFT JOIN GO_INBOUND E ON B.FMASTERID = E.fID LEFT JOIN GO_GOODSPURCHASEDETAIL C ON C.FGOODSENCODING = B.FGOODSENCODING LEFT JOIN GO_GOODSPURCHASE D ON  (C.FMASTERID = D.fID) AND (D.FBILLNUMBER = E.FCONTRACTNO)  LEFT JOIN (SELECT  GO_InboundDetail.FGOODSENCODING AS GO_InboundDetail_fGoodsEncoding, GO_Inbound.FCONTRACTNO AS GO_Inbound_fContractNO, NVL(SUM(GO_InboundDetail.FCOUNT), ?) AS fCount FROM GO_INBOUNDDETAIL GO_InboundDetail LEFT JOIN GO_INBOUND GO_Inbound ON GO_Inbound.fID = GO_InboundDetail.FMASTERID  WHERE GO_Inbound.FBILLSTATUS = ?   GROUP BY fGoodsEncoding, fContractNO) A ON  (A.fGoodsEncoding = C.FGOODSENCODING) AND (A.fContractNO = D.FBILLNUMBER)   WHERE  (E.FBILLNUMBER = ?) AND (D.FBILLNUMBER = ?)
--> binds: [0, 0, 已完成, RKD2017060184, GPP2017060012]
        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 GoodsManage.compare(GoodsManage.java:50)
        ... 27 more

Caused by: com.justep.exception.BusinessException: 编码: JUSTEP150039; 提示: 执行sql: SELECT  C.FGOODSENCODING AS fGoodsEncoding, E.FCONTRACTNO AS fContractNO, B.FCOUNT AS fCount, ( C.FQUANTITY - NVL(A.fCount, ?) ) AS fNeedCount FROM GO_INBOUNDDETAIL B LEFT JOIN GO_INBOUND E ON B.FMASTERID = E.fID LEFT JOIN GO_GOODSPURCHASEDETAIL C ON C.FGOODSENCODING = B.FGOODSENCODING LEFT JOIN GO_GOODSPURCHASE D ON  (C.FMASTERID = D.fID) AND (D.FBILLNUMBER = E.FCONTRACTNO)  LEFT JOIN (SELECT  GO_InboundDetail.FGOODSENCODING AS GO_InboundDetail_fGoodsEncoding, GO_Inbound.FCONTRACTNO AS GO_Inbound_fContractNO, NVL(SUM(GO_InboundDetail.FCOUNT), ?) AS fCount FROM GO_INBOUNDDETAIL GO_InboundDetail LEFT JOIN GO_INBOUND GO_Inbound ON GO_Inbound.fID = GO_InboundDetail.FMASTERID  WHERE GO_Inbound.FBILLSTATUS = ?   GROUP BY fGoodsEncoding, fContractNO) A ON  (A.fGoodsEncoding = C.FGOODSENCODING) AND (A.fContractNO = D.FBILLNUMBER)   WHERE  (E.FBILLNUMBER = ?) AND (D.FBILLNUMBER = ?) , binds: [0, 0, 已完成, RKD2017060184, GPP2017060012]出错
        at com.justep.exception.BusinessException.create(Unknown Source)
        at com.justep.system.ksql.KSQLUtils.execSqlSelect(Unknown Source)
        ... 32 more

Caused by: java.sql.SQLException: ORA-00972: 标识符过长

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:213)
        at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:796)
        at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1031)
        at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:836)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1124)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
        at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
        ... 33 more
回复 支持 反对

使用道具 举报

423

主题

813

帖子

3035

积分

论坛元老

Rank: 8Rank: 8

积分
3035
QQ
 楼主| 发表于 2017-6-16 09:31:50 | 显示全部楼层
youmi 发表于 2017-6-16 09:30
2017-06-16 09:23:45 excute stream action, params:{"accept":"application/json","action":"compare"," ...

其中ksql GO_InboundDetail.fGoodsEncoding转换成sql 就变成了GO_InboundDetail.FGOODSENCODING AS GO_InboundDetail_fGoodsEncoding
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36069
发表于 2017-6-16 10:53:28 | 显示全部楼层
关联查询的如果没有自己as别名,平台默认的会把概念别和关系名组合拼接为as的别名
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-25 16:51 , Processed in 0.116978 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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