使用mybatis查询mysql数据库 先调用存储过程,然后再inner join 存储过程返回的临时表出错 高手帮忙看下!
<selectid="getTreeObjsV4"statementType="CALLABLE"resultType="com.gw.fundHolders.detai...
<select id="getTreeObjsV4" statementType="CALLABLE" resultType="com.gw.fundHolders.detail.domain.Result"><![CDATA[
call gettreeobjsV4(#{did}, #{searchnodes},#{depth}, #{lang})
]]></select>
<select id="calFundDetailsHolders" resultType="com.gw.fundHolders.detail.domain.Detail" parameterType="map"><![CDATA[
SELECT substring(b.co, 3, 6) AS fundCode,
b.c3 AS fundShort,
a.c2 AS reportDate,
c.c3 AS latestShare,
a.c3 AS holderHolds,
a.c5/10000 AS worthHolding,
a.c6/10000 AS instHolding,
a.c7 AS instProportion,
a.c14/10000 AS indHolding,
a.c15 as indProportion,
a.c12/10000 as fundHolding,
a.c13 as fundProportion,
a.c8/10000 as managerHolding,
a.c9 as managerProportion,
a.c10/10000 as holderHolding,
a.c11 as holderProportion ,
a.c16/10000 as staffHolding,
a.c17 as staffProportion,
if(b.c20 regexp '基金$',substring(b.c20, 1, CHAR_LENGTH(b.c20)-2 ),b.c20 ) as fundType,
b.c23 as fundTypeDetails,
b.c8 as fundManager,
b.c12 as fundCustodian
FROM ST25119_main a inner join gettreeobjsV4_result result on a.co=result.obj
LEFT JOIN ST25103_main b ON a.co=b.co
LEFT JOIN ST25158_main c ON a.co=c.co and a.c2=c.c1
where a.c2 =#{reportDate}
order by a.co
]]> 展开
call gettreeobjsV4(#{did}, #{searchnodes},#{depth}, #{lang})
]]></select>
<select id="calFundDetailsHolders" resultType="com.gw.fundHolders.detail.domain.Detail" parameterType="map"><![CDATA[
SELECT substring(b.co, 3, 6) AS fundCode,
b.c3 AS fundShort,
a.c2 AS reportDate,
c.c3 AS latestShare,
a.c3 AS holderHolds,
a.c5/10000 AS worthHolding,
a.c6/10000 AS instHolding,
a.c7 AS instProportion,
a.c14/10000 AS indHolding,
a.c15 as indProportion,
a.c12/10000 as fundHolding,
a.c13 as fundProportion,
a.c8/10000 as managerHolding,
a.c9 as managerProportion,
a.c10/10000 as holderHolding,
a.c11 as holderProportion ,
a.c16/10000 as staffHolding,
a.c17 as staffProportion,
if(b.c20 regexp '基金$',substring(b.c20, 1, CHAR_LENGTH(b.c20)-2 ),b.c20 ) as fundType,
b.c23 as fundTypeDetails,
b.c8 as fundManager,
b.c12 as fundCustodian
FROM ST25119_main a inner join gettreeobjsV4_result result on a.co=result.obj
LEFT JOIN ST25103_main b ON a.co=b.co
LEFT JOIN ST25158_main c ON a.co=c.co and a.c2=c.c1
where a.c2 =#{reportDate}
order by a.co
]]> 展开
2个回答
展开全部
这个错误报文上写的很明确啊。就是在你那个数据库中gettreeobjsV4_result 表根本不存在。所以报的jdbc的错误啊。
你使用mysql fount 看一下 select * from gettreeobjsV4_result
有没有问题。
你使用mysql fount 看一下 select * from gettreeobjsV4_result
有没有问题。
更多追问追答
追问
额,我知道不存在,这个临时表是调用存储过程返回的,我在select前先调用了存储过程,肯定会产生这个临时表的,但是不知道它为么子还报这错误
追答
mysql 不存在视图啊。临时表不会保存的啊。
而且,我不知道你的查询是怎么写的。你们是一次会话么?在一个事务中么?
2012-07-12
展开全部
出错就先把错误贴出来啊,才有针对性
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询