You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "dabingRyan (via GitHub)" <gi...@apache.org> on 2023/02/28 16:04:37 UTC
[GitHub] [shardingsphere] dabingRyan commented on issue #24207: java.sql.SQLFeatureNotSupportedException: can't get index from columnLabel[xxxxxxxxx]
dabingRyan commented on issue #24207:
URL: https://github.com/apache/shardingsphere/issues/24207#issuecomment-1448443745
my SQL statements is:
`
select *
from (select a.CLIENT client,
a.PRO_SITE storeId,
f.STO_NAME stoName,
a.PRO_SELF_CODE proCode,
a.PRO_DEPICT proDepict,
a.PRO_PYM proPym,
IFNULL(SUM(b.GSSB_QTY), 0) AS inventoryQty
from GAIA_PRODUCT_BUSINESS a
LEFT JOIN GAIA_SD_STOCK_BATCH b on a.PRODUCT_ID = b.PRODUCT_ID
WHERE a.CLIENT = 'ABCD') aa;
`
there is an exception
`Can not get index from column label `inventoryQty`.; nested exception is java.sql.SQLFeatureNotSupportedException: Can not get index from column label `inventoryQty`.>
org.springframework.dao.InvalidDataAccessApiUsageException: Error attempting to get column 'inventoryQty' from result set. Cause: java.sql.SQLFeatureNotSupportedException: Can not get index from column label `inventoryQty`.
; Can not get index from column label `inventoryQty`.; nested exception is java.sql.SQLFeatureNotSupportedException: Can not get index from column label `inventoryQty`.
at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:96)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439)
at com.sun.proxy.$Proxy110.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224)
at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)
at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:145)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)
at com.sun.proxy.$Proxy174.findListForHisClinicZhongXiPage(Unknown Source)
at com.gov.external.modules.product.service.impl.ProductServiceImpl.searchClinicPage(ProductServiceImpl.java:338)
at com.gov.external.modules.product.service.impl.ProductServiceImpl$$FastClassBySpringCGLIB$$8fc4ea9f.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)`
But when I delete the outermost alias aa, it's ok!
like this :
`select a.CLIENT client,
a.PRO_SITE storeId,
f.STO_NAME stoName,
a.PRO_SELF_CODE proCode,
a.PRO_DEPICT proDepict,
a.PRO_PYM proPym,
IFNULL(SUM(b.GSSB_QTY), 0) AS inventoryQty
from GAIA_PRODUCT_BUSINESS a
LEFT JOIN GAIA_SD_STOCK_BATCH b on a.PRODUCT_ID = b.PRODUCT_ID
WHERE a.CLIENT = 'ABCD'`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org