最近部署项目的时候发现这样一个问题:ORA-32036: 不支持 WITH 子句中串联式查询名的形式
这是项目部署完,启动之后,点击具体功能时候报的。
我看了一下后台,和一个sql查询有关。
sql是这样的:
with temp1_start as
(select buid, mainbuid
from relationship
where funtypeid = 28
and sysdate >= effdate
and (sysdate <= enddate or enddate is null)
and dropped = 'F'
and buid in (select distinct a.buid
from relationship a, bu b
where a.buid = b.buid
and b.unittypeid != '17'
and b.outtype = 0
and (b.createid = '304' or
(a.mainbuid = '304' and
(a.funtypeid = 39 or a.funtypeid = 28))))),
temp1 as
(select buid, mainbuid
from relationship
Connect by prior buid = mainbuid
and (sysdate <= enddate or enddate is null)
and dropped = 'F'
and funtypeid = 28
and sysdate >= effdate
Start with buid in (select buid from temp1_start)
and funtypeid = 28
and sysdate >= effdate
and (sysdate <= enddate or enddate is null)
and dropped = 'F')
select distinct a.buid
from temp1 a, BU b
where a.mainbuid not in (select distinct buid from temp1)
and a.buid = b.buid
用了with和临时表。
但是问题是:我之前这个sql没问题,这个sql在库里面执行也没问题。然后报的错误往深一点去看好像还和jdbc有关系。。
我整了半天没头绪。
突然想起,我的项目的web容器用的是weblogic,weblogic在部署项目的时候需要配置数据源,那这个会不会和数据源的驱动有关那?因为在Stack Overflow上面看到的解答都是和数据库版本有关的内容,所以我打算换个数据源驱动
换完之后重新启动发现好了。
所以,这个还是和数据库的版本,驱动有关系,遇到这样的问题还是去看一下容器和数据库之间相关的配置文件是不是有问题